{"answers":{"affected":"2 open source packages ship an affected version, including sharp. It affects 1 product.","exploited":"There is no known exploitation of CVE-2022-29256 in the wild and no public exploit code.","fix":"Upgrade sharp to 0.30.5 or later.","what":"CVE-2022-29256 is a medium-severity command injection vulnerability in lovell sharp, published on 25 May 2022. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2022-29256 and fix it if it is affected.\n\nWhat it is: CVE-2022-29256 is a medium-severity command injection vulnerability in lovell sharp, published on 25 May 2022. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2022-29256 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- sharp (npm): affected all versions; fixed in 0.30.5\n- sharp (npm): affected all versions; fixed in 0.30.5\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-2022-29256/ (Markdown: https://insights.sbomify.com/CVE-2022-29256/index.md)","id":"CVE-2022-29256","markdown":"https://insights.sbomify.com/CVE-2022-29256/index.md","name":"CVE-2022-29256","record":{"aliases":["CLSA-2026-1789549875","GHSA-gp95-ppv5-3jc5"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"adjacent_or_local","non_default_config":true,"product_category":"Node.js image processing library","requires_auth":"high_privilege","summary":"An attacker controlling the build environment can inject arbitrary commands during npm install via PKG_CONFIG_PATH manipulation in sharp.","user_interaction":"required","vuln_class":"command_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"sharp","vendor":"sharp_project"}],"cvss":{"score":6.5,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:L/AC:L/PR:H/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"},{"id":"CWE-77","name":"Improper Neutralization of Special Elements used in a Command"}],"description":"sharp is an application for Node.js image processing. Prior to version 0.30.5, there is a possible vulnerability in logic that is run only at `npm install` time when installing versions of `sharp` prior to the latest v0.30.5. If an attacker has the ability to set the value of the `PKG_CONFIG_PATH` environment variable in a build environment then they might be able to use this to inject an arbitrary command at `npm install` time. This is not part of any runtime code, does not affect Windows users at all, and is unlikely to affect anyone that already cares about the security of their build environment. This problem is fixed in version 0.30.5.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Possible vulnerability at 'npm install' time in sharp if an attacker has control over build environment","id":"CVE-2022-29256","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"command_injection","year":"2022"},"n_packages":2,"n_references":2,"next":{"headline":"Electron's AutoUpdater module fails to validate certain nested components of the bundle","id":"CVE-2022-29257"},"packages":[{"ecosystem":"npm","fixed":["0.30.5"],"introduced":["0"],"last_affected":[],"package":"sharp","purl":null,"source":"GHSA-gp95-ppv5-3jc5"},{"ecosystem":"npm","fixed":["0.30.5"],"introduced":["0"],"last_affected":[],"package":"sharp","purl":"pkg:npm/sharp","source":"GHSA-gp95-ppv5-3jc5"}],"prev":{"headline":"Multiple evaluation of contract address in call in vyper","id":"CVE-2022-29255"},"products":["sharp"],"published":"2022-05-25","related":[],"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":"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)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"total"},"state":"PUBLISHED","updated":"2025-04-23","vendors":["lovell"]},"summary":"An attacker controlling the build environment can inject arbitrary commands during npm install via PKG_CONFIG_PATH manipulation in sharp.","url":"https://insights.sbomify.com/CVE-2022-29256/"}