CVE-2021-23438
mpath: type confusion can lead to a bypass of CVE-2018-16490
Severity by source
Trivy's own label is CRITICAL. Rated critical by NVD. Rated lower by GHSA (medium), Red Hat (medium).
Description
This affects the package mpath before 0.8.4. A type confusion vulnerability can lead to a bypass of CVE-2018-16490. In particular, the condition ignoreProperties.indexOf(parts[i]) !== -1 returns -1 if parts[i] is ['__proto__']. This is because the method that has been called if the input is an array is Array.prototype.indexOf() and not String.prototype.indexOf(). They behave differently depending on the type of the input.
Affected packages and fixed versions
| Source | Package | Fixed in |
|---|---|---|
| npm::GitHub Security Advisory npm | mpath | 0.8.4 |
References
- https://access.redhat.com/security/cve/CVE-2021-23438
- https://github.com/aheckmann/mpath
- https://github.com/aheckmann/mpath/commit/89402d2880d4ea3518480a8c9847c541f2d824fc
- https://github.com/mongoosejs/mpath/commit/89402d2880d4ea3518480a8c9847c541f2d824fc
- https://hackerone.com/reports/390860
- https://nvd.nist.gov/vuln/detail/CVE-2021-23438
- https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-1579548
- https://snyk.io/vuln/SNYK-JS-MPATH-1577289