{"answers":{"affected":"3 open source packages ship an affected version, including yt-dlp. It affects 1 product.","exploited":"There is no known exploitation of CVE-2026-26331 in the wild and no public exploit code.","fix":"Upgrade yt-dlp to 2026.02.21 or later.","what":"CVE-2026-26331 is a high-severity command injection vulnerability in yt-dlp, published on 24 Feb 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2026-26331 and fix it if it is affected.\n\nWhat it is: CVE-2026-26331 is a high-severity command injection vulnerability in yt-dlp, published on 24 Feb 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2026-26331 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- yt-dlp (PyPI): affected from 2023.06.21; fixed in 2026.02.21\n- yt-dlp (PyPI): affected from 2023.06.21; fixed in 2026.02.21\n- yt-dlp (PyPI): affected from 2023.06.21; fixed in 2026.02.21\n\nTask:\n1. 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.\n2. 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.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2026-26331/ (Markdown: https://insights.sbomify.com/CVE-2026-26331/index.md)","id":"CVE-2026-26331","markdown":"https://insights.sbomify.com/CVE-2026-26331/index.md","name":"CVE-2026-26331","record":{"aliases":["DEBIAN-CVE-2026-26331","GHSA-g3gw-q23r-pgqm","MGASA-2026-0054","PYSEC-2026-3432","ROOT-APP-PYPI-CVE-2026-26331","UBUNTU-CVE-2026-26331"],"analysis":{"component_type":"developer_tool","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":true,"product_category":"yt-dlp downloader","requires_auth":"none","summary":"Attackers can execute arbitrary commands on user systems via malicious URLs if the --netrc-cmd option is enabled in yt-dlp.","user_interaction":"required","vuln_class":"command_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"yt-dlp","vendor":"yt-dlp_project"}],"cvss":{"score":8.8,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-78","name":"Improper Neutralization of Special Elements used in an OS Command"}],"description":"yt-dlp is a command-line audio/video downloader. Starting in version 2023.06.21 and prior to version 2026.02.21, when yt-dlp's `--netrc-cmd` command-line option (or `netrc_cmd` Python API parameter) is used, an attacker could achieve arbitrary command injection on the user's system with a maliciously crafted URL. yt-dlp maintainers assume the impact of this vulnerability to be high for anyone who uses `--netrc-cmd` in their command/configuration or `netrc_cmd` in their Python scripts. Even though the maliciously crafted URL itself will look very suspicious to many users, it would be trivial for a maliciously crafted webpage with an inconspicuous URL to covertly exploit this vulnerability via HTTP redirect. Users without `--netrc-cmd` in their arguments or `netrc_cmd` in their scripts are unaffected. No evidence has been found of this exploit being used in the wild. yt-dlp version 2026.02.21 fixes this issue by validating all netrc \"machine\" values and raising an error upon unexpected input. As a workaround, users who are unable to upgrade should avoid using the `--netrc-cmd` command-line option (or `netrc_cmd` Python API parameter), or they should at least not pass a placeholder (`{}`) in their `--netrc-cmd` argument.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":"2026-02-22","github_poc":1,"max_poc_stars":1,"metasploit":0,"nuclei":0,"refs":[{"date":"2026-02-22T15:42:57Z","kind":"github_poc","ref":"https://github.com/dxlerYT/CVE-2026-26331","stars":1,"title":"Proof of Concept for an arbitrary command injection vulnerability in yt-dlp’s --netrc-cmd option (GHSA-g3gw-q23r-pgqm / CVE-2026-26331). Demonstrates shell command execution via maliciously crafted URLs in affected versions (≥ 2023.06.21, \u003c 2026.02.21)."}],"tier":"poc_unverified"},"has_fix":true,"headline":"yt-dlp: Arbitrary Command Injection when using the `--netrc-cmd` option","id":"CVE-2026-26331","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"command_injection","year":"2026"},"n_packages":3,"n_references":3,"next":{"headline":"vm2: Sandbox Escape","id":"CVE-2026-26332"},"packages":[{"ecosystem":"PyPI","fixed":["2026.02.21"],"introduced":["2023.06.21"],"last_affected":[],"package":"yt-dlp","purl":null,"source":"GHSA-g3gw-q23r-pgqm"},{"ecosystem":"PyPI","fixed":["2026.02.21"],"introduced":["2023.06.21"],"last_affected":[],"package":"yt-dlp","purl":"pkg:pypi/yt-dlp","source":"GHSA-g3gw-q23r-pgqm"},{"ecosystem":"PyPI","fixed":["2026.02.21"],"introduced":["2023.06.21"],"last_affected":[],"package":"yt-dlp","purl":"pkg:pypi/yt-dlp","source":"PYSEC-2026-3432"}],"prev":{"headline":"Envoy's global rate limit may crash when the response phase limit is enabled and the response phase request is failed directly","id":"CVE-2026-26330"},"products":["yt-dlp"],"published":"2026-02-24","related":[{"cvss_score":8.4,"headline":"yt-dlp `--exec` command injection when using `%q` in yt-dlp on Windows","id":"CVE-2024-22423","kev_date_added":null,"published":"2024-04-09"},{"cvss_score":8.4,"headline":"yt-dlp command injection when using `%q` in `--exec` on Windows","id":"CVE-2023-40581","kev_date_added":null,"published":"2023-09-25"},{"cvss_score":8.3,"headline":"yt-dlp: Dangerous file type creation via insufficient filename sanitization (Bypass of CVE-2024-38519)","id":"CVE-2026-50023","kev_date_added":null,"published":"2026-06-23"},{"cvss_score":8.3,"headline":"yt-dlp: Arbitrary code execution via manifest downloads with aria2c","id":"CVE-2026-50574","kev_date_added":null,"published":"2026-06-23"},{"cvss_score":7.5,"headline":"yt-dlp: Downstream command injection via improper sanitization of yt-dlp --write-link output","id":"CVE-2026-55404","kev_date_added":null,"published":"2026-07-08"},{"cvss_score":7.5,"headline":"yt-dlp allows `--exec` command injection when using placeholder on Windows","id":"CVE-2025-54072","kev_date_added":null,"published":"2025-07-22"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"total"},"state":"PUBLISHED","updated":"2026-02-24","vendors":["yt-dlp"]},"summary":"Attackers can execute arbitrary commands on user systems via malicious URLs if the --netrc-cmd option is enabled in yt-dlp.","url":"https://insights.sbomify.com/CVE-2026-26331/"}