MediumGHSA-r5xw-q988-826m

Remote Memory Exposure in mongoose

Published 1 Sept 2020 · Updated 7 Dec 2023

Affected packages

Affected
>=3.5.5 <3.8.39
Fixed in
3.8.39
Update to the fixed version for your release line, for example:npm install mongoose@3.8.39
Affected
>=4.0.0 <4.3.6
Fixed in
4.3.6
Update to the fixed version for your release line, for example:npm install mongoose@4.3.6

Details

Versions of mongoose before 4.3.6, 3.8.39 are vulnerable to remote memory exposure.

Trying to save a number to a field of type Buffer on the affected mongoose versions allocates a chunk of uninitialized memory and stores it in the database.

Recommendation

Update to version 4.3.6, 3.8.39 or later.

Is GHSA-r5xw-q988-826m in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected mongoose, and gives you the command that fixes it.

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.