# CVE-2020-7608: yargs-parser Vulnerable to Prototype Pollution


- **Severity:** Medium 5.3 (`CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 16 Mar 2020
- **Updated:** 4 Aug 2024
- **Also known as:** CLSA-2026-1774225193, CLSA-2026-1774225196, CLSA-2026-1774225198, CLSA-2026-1774225199, CLSA-2026-1777336759, DEBIAN-CVE-2020-7608, GHSA-p9pc-299p-vxgp, MGASA-2021-0170, SNYK-JS-YARGSPARSER-560381, UBUNTU-CVE-2020-7608

## What is CVE-2020-7608?

CVE-2020-7608 is a medium-severity vulnerability in yargs-parser, published on 16 Mar 2020. 

### Official description

yargs-parser could be tricked into adding or modifying properties of Object.prototype using a "__proto__" payload.

Weakness: CWE-1321 (Improperly Controlled Modification of Object Prototype Attributes)

## Which versions are affected by CVE-2020-7608?

8 open source packages ship an affected version, including yargs-parser. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `yargs-parser` | npm | All versions | 5.0.1 |
| `yargs-parser` | npm | All versions | 5.0.1 |
| `yargs-parser` | npm | From 14.0.0 | 15.0.1 |
| `yargs-parser` | npm | From 14.0.0 | 15.0.1 |
| `yargs-parser` | npm | From 16.0.0 | 18.1.1 |
| `yargs-parser` | npm | From 16.0.0 | 18.1.1 |
| `yargs-parser` | npm | From 6.0.0 | 13.1.2 |
| `yargs-parser` | npm | From 6.0.0 | 13.1.2 |

Products: Yargs Yargs-Parser.

## How do I fix CVE-2020-7608?

Upgrade yargs-parser to a fixed version for your release line: 5.0.1, 15.0.1, 18.1.1 or 13.1.2.

## Is CVE-2020-7608 being exploited?

There is no known exploitation of CVE-2020-7608 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2020-7608 and fix it if it is affected.

What it is: CVE-2020-7608 is a medium-severity vulnerability in yargs-parser, published on 16 Mar 2020. 
Exploitation: There is no known exploitation of CVE-2020-7608 in the wild and no public exploit code.

Affected packages and fixed versions:
- yargs-parser (npm): affected all versions; fixed in 5.0.1
- yargs-parser (npm): affected all versions; fixed in 5.0.1
- yargs-parser (npm): affected from 14.0.0; fixed in 15.0.1
- yargs-parser (npm): affected from 14.0.0; fixed in 15.0.1
- yargs-parser (npm): affected from 16.0.0; fixed in 18.1.1
- yargs-parser (npm): affected from 16.0.0; fixed in 18.1.1
- yargs-parser (npm): affected from 6.0.0; fixed in 13.1.2
- yargs-parser (npm): affected from 6.0.0; fixed in 13.1.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2020-7608/ (Markdown: https://insights.sbomify.com/CVE-2020-7608/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2020-7608
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2020-7608
- OSV: https://osv.dev/vulnerability/CVE-2020-7608

---
From sbomify Insights: https://insights.sbomify.com/CVE-2020-7608/
Summaries are generated and may contain mistakes; the official description above is the record.
