{"answers":{"affected":"2 open source packages ship an affected version, including KnpLabs/knp-snappy.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-46643 exists.","fix":"Upgrade KnpLabs/knp-snappy to 1.7.1 or later.","what":"CVE-2026-46643 is a high-severity command injection vulnerability in KnpLabs snappy, published on 10 Jun 2026. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2026-46643 and fix it if it is affected.\n\nWhat it is: CVE-2026-46643 is a high-severity command injection vulnerability in KnpLabs snappy, published on 10 Jun 2026. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-46643 exists.\n\nAffected packages and fixed versions:\n- KnpLabs/knp-snappy (Packagist): affected all versions; fixed in 1.7.1\n- KnpLabs/knp-snappy (Packagist): affected all versions; fixed in 1.7.1\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-46643/ (Markdown: https://insights.sbomify.com/CVE-2026-46643/index.md)","id":"CVE-2026-46643","markdown":"https://insights.sbomify.com/CVE-2026-46643/index.md","name":"CVE-2026-46643","record":{"aliases":["GHSA-vpr4-p6fq-85jc"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"adjacent_or_local","non_default_config":true,"product_category":"PHP PDF generation library","requires_auth":"none","summary":"Attackers can execute arbitrary commands if the binary path is influenced by user-controlled configuration or environment variables due to improper shell escaping.","user_interaction":"not_required","vuln_class":"command_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[],"cvss":{"score":7.5,"severity":"high","source":"cna","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","version":"4.0"},"cwes":[{"id":"CWE-78","name":"Improper Neutralization of Special Elements used in an OS Command"}],"description":"Snappy is a PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Prior to version 1.7.1, on POSIX, escapeshellarg(‘/usr/bin/wkhtmltopdf’) returns the literal string ‘/usr/bin/wkhtmltopdf’ with the single-quote characters included. is_executable() then looks for a file whose actual name contains those quote characters, which essentially never exists. The safe branch is dead code and $command always falls through to the raw, unescaped value. The rest of the arguments (options, input, output) are escaped correctly, so injection has to land in the binary string itself. That happens whenever the binary path is sourced from configuration that is user-influenced, derived from environment variables that ultimately come from request data, or concatenated with any user-controlled fragment. This issue has been patched in version 1.7.1.","ecosystems":["Packagist"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"Snappy: Binary path is never shell-escaped due to an inverted is_executable check","id":"CVE-2026-46643","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Packagist","product":null,"products":[],"type":"command_injection","year":"2026"},"n_packages":2,"n_references":2,"next":{"headline":"symfony/polyfill-intl-idn accepts xn-- labels whose Punycode payload decodes to ASCII-only: insecure equivalence","id":"CVE-2026-46644"},"packages":[{"ecosystem":"Packagist","fixed":["1.7.1"],"introduced":["0"],"last_affected":[],"package":"KnpLabs/knp-snappy","purl":null,"source":"GHSA-vpr4-p6fq-85jc"},{"ecosystem":"Packagist","fixed":["1.7.1"],"introduced":["0"],"last_affected":[],"package":"KnpLabs/knp-snappy","purl":"pkg:composer/KnpLabs/knp-snappy","source":"GHSA-vpr4-p6fq-85jc"}],"prev":{"headline":"draw.io: XSS via crafted cell label when opening a .drawio file","id":"CVE-2026-46642"},"products":["snappy"],"published":"2026-06-10","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":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"poc","technical_impact":"total"},"state":"PUBLISHED","updated":"2026-06-11","vendors":["KnpLabs"]},"summary":"Attackers can execute arbitrary commands if the binary path is influenced by user-controlled configuration or environment variables due to improper shell escaping.","url":"https://insights.sbomify.com/CVE-2026-46643/"}