GHSA-xvch-5gv4-984h CVE-2021-44906
Prototype Pollution in minimist
- Severity
- 9.8 / 10
- Critical · CVSS 3.1
- Exploit chance (EPSS)
- 4.58%
- Chance of exploitation in the next 30 days. Higher than 91.63% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-1321 Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
- Fix
1.2.6- Upgrade minimist to this version or later
Description
Minimist prior to 1.2.6 and 0.2.4 is vulnerable to Prototype Pollution via file index.js, function setKey() (lines 69-95).
Affected versions
npm
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
minimist npm → 1.2.6
- npm
npm install minimist@1.2.6- yarn
yarn add minimist@1.2.6- pnpm
pnpm add minimist@1.2.6
Severity breakdown
CVSS 3.1 9.8
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Weakness
CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
The product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype.
How to prevent it
- Implementation: By freezing the object prototype first (for example, Object.freeze(Object.prototype)), modification of the prototype becomes impossible.
- Architecture and Design: By blocking modifications of attributes that resolve to object prototype, such as proto or prototype, this weakness can be mitigated.
- Implementation: When handling untrusted objects, validating using a schema can be used.
- Implementation: By using an object without prototypes (via Object.create(null) ), adding object prototype attributes by accessing the prototype via the special attributes becomes impossible, mitigating this weakness.
- Implementation: Map can be used instead of objects in most cases. If Map methods are used instead of object attributes, it is not possible to access the object prototype or modify it.
References
Advisories
Packages
Other links
- github.com/minimistjs/minimist/issues/11
- github.com/substack/minimist/issues/164
- github.com/minimistjs/minimist/pull/24
- github.com/minimistjs/minimist/commit/34e20b8461118608703d6485326abbb8e35e1703
- github.com/minimistjs/minimist/commit/bc8ecee43875261f4f17eb20b1243d3ed15e70eb
- github.com/minimistjs/minimist/commit/c2b981977fa834b223b408cfb860f933c9811e4d
- github.com/minimistjs/minimist/commit/ef9153fc52b6cea0744b2239921c5dcae4697f11
- github.com/Marynk/JavaScript-vulnerability-detection/blob/main/minimist%20PoC.zip
- github.com/minimistjs/minimist/commits/v0.2.4
- github.com/substack/minimist/blob/master/index.js
- security.netapp.com/advisory/ntap-20240621-0006
- snyk.io/vuln/SNYK-JS-MINIMIST-559764
- stackoverflow.com/questions/8588563/adding-custom-properties-to-a-function/20278068
- security.netapp.com/advisory/ntap-20240621-0006
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-vh95-rmgr-6w4m Prototype Pollution in minimist | Medium | Also affects minimist |
| GHSA-6wvx-3r32-xmcg Forge: Prototype Pollution in forge.http cookie handling via a malicious Set-Cookie | Medium | Same weakness, CWE-1321 |
| GHSA-7648-jmwf-vw7j systeminformation has prototype pollution in `networkStats()` via the interface name | Medium | Same weakness, CWE-1321 |
| GHSA-m2m5-rw3w-cwmj ApostropheCMS: Client-side Prototype Pollution in apos.http.parseQuery leading to DOM-based XSS against authenticated users | Medium | Same weakness, CWE-1321 |
| GHSA-j5rq-xfvr-p969 ApostropheCMS: Authenticated projection-exclusion prototype-member deletion in @apostrophecms/db-connect causes process-wide denial of service | High | Same weakness, CWE-1321 |
| GHSA-97rh-rhh2-7vjv Payload: Remote Code Execution through first-register | High | Same weakness, CWE-1321 |
| GHSA-4q55-j62x-fr9h devalue: Malformed null-prototype object keys bypass __proto__ rejection via property-key coercion | Medium | Same weakness, CWE-1321 |
| GHSA-x97p-jq2g-jp4f Axios: Prototype Pollution Gadget in axios toFormData Options | High | Same weakness, CWE-1321 |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor