GHSA-f5cv-xrv9-r8w7

Suggest an improvement
Source
https://github.com/advisories/GHSA-f5cv-xrv9-r8w7
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2020/09/GHSA-f5cv-xrv9-r8w7/GHSA-f5cv-xrv9-r8w7.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-f5cv-xrv9-r8w7
Published
2020-09-01T21:17:16Z
Modified
2021-09-24T20:58:36Z
Summary
NoSQL injection in express-cart
Details

Versions of express-cart before 1.1.8 are vulnerable to NoSQL injection.

The vulnerability is caused by the lack of user input sanitization in the login handlers. In both cases, the customer login and the admin login, parameters from the JSON body are sent directly into the MongoDB query which allows to insert operators.

These operators can be used to extract the value of the field blindly in the same manner of a blind SQL injection. In this case, the $regex operator is used to guess each character of the token from the start.

Recommendation

Update to version 1.1.8 or later.

Database specific
{
    "cwe_ids":  [
        "CWE-89"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2020-08-31T18:33:28Z",
    "nvd_published_at":  null,
    "severity":  "HIGH"
}
References

Affected packages

npm / express-cart

Package

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
1.1.8

Database specific

last_known_affected_version_range
"<= 1.1.7"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2020/09/GHSA-f5cv-xrv9-r8w7/GHSA-f5cv-xrv9-r8w7.json"