{"answers":{"affected":"4 open source packages ship an affected version, including twig/cssinliner-extra and twig/markdown-extra. It affects 1 product.","exploited":"There is no known exploitation of CVE-2026-46637 in the wild and no public exploit code.","fix":"Upgrade twig/cssinliner-extra to 3.26.0 or later.","what":"CVE-2026-46637 is a medium-severity cross-site scripting vulnerability in Twig, published on 14 Jul 2026. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2026-46637 and fix it if it is affected.\n\nWhat it is: CVE-2026-46637 is a medium-severity cross-site scripting vulnerability in Twig, published on 14 Jul 2026. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2026-46637 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- twig/cssinliner-extra (Packagist): affected all versions; fixed in 3.26.0\n- twig/cssinliner-extra (Packagist): affected all versions; fixed in 3.26.0\n- twig/markdown-extra (Packagist): affected all versions; fixed in 3.26.0\n- twig/markdown-extra (Packagist): affected all versions; fixed in 3.26.0\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-46637/ (Markdown: https://insights.sbomify.com/CVE-2026-46637/index.md)","id":"CVE-2026-46637","markdown":"https://insights.sbomify.com/CVE-2026-46637/index.md","name":"CVE-2026-46637","record":{"aliases":["DEBIAN-CVE-2026-46637","GHSA-jv8m-2544-3pg3","UBUNTU-CVE-2026-46637"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"PHP template library","requires_auth":"low_privilege","summary":"Attackers can inject malicious scripts via Twig markdown or CSS inliner filters due to incorrect safe output declarations, leading to XSS.","user_interaction":"required","vuln_class":"xss"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"twig","vendor":"symfony"}],"cvss":{"score":5.1,"severity":"medium","source":"cna","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","version":"4.0"},"cwes":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"},{"id":"CWE-116","name":"Improper Encoding or Escaping of Output"}],"description":"Twig is a template language for PHP. Prior to 3.26.0, several filters in twig/markdown-extra and twig/cssinliner-extra are registered with is_safe =\u003e [all], causing Twig to treat plain text or HTML output as safe in HTML, JavaScript, CSS, URL, and other contexts where the output is not properly escaped. This issue is fixed in version 3.26.0.","ecosystems":["Packagist"],"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":"Twig: HTML-output filters in twig/* extras incorrectly declared `is_safe =\u003e ['all']`","id":"CVE-2026-46637","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Packagist","product":null,"products":[],"type":"xss","year":"2026"},"n_packages":4,"n_references":4,"next":{"headline":"Twig: `{% sandbox %}{% include %}` skips checkSecurity() on cached templates (incomplete fix for CVE-2024-45411)","id":"CVE-2026-46638"},"packages":[{"ecosystem":"Packagist","fixed":["3.26.0"],"introduced":["0"],"last_affected":[],"package":"twig/cssinliner-extra","purl":null,"source":"GHSA-jv8m-2544-3pg3"},{"ecosystem":"Packagist","fixed":["3.26.0"],"introduced":["0"],"last_affected":[],"package":"twig/cssinliner-extra","purl":"pkg:composer/twig/cssinliner-extra","source":"GHSA-jv8m-2544-3pg3"},{"ecosystem":"Packagist","fixed":["3.26.0"],"introduced":["0"],"last_affected":[],"package":"twig/markdown-extra","purl":null,"source":"GHSA-jv8m-2544-3pg3"},{"ecosystem":"Packagist","fixed":["3.26.0"],"introduced":["0"],"last_affected":[],"package":"twig/markdown-extra","purl":"pkg:composer/twig/markdown-extra","source":"GHSA-jv8m-2544-3pg3"}],"prev":{"headline":"Twig: Sandbox method allowlist bypass via `Markup` subclass","id":"CVE-2026-46636"},"products":["Twig","cssinliner-extra","markdown-extra"],"published":"2026-07-14","related":[{"cvss_score":9.8,"headline":"Code injection in n/a","id":"CVE-2018-13818","kev_date_added":null,"published":"2018-07-10"},{"cvss_score":8.7,"headline":"Twig: PHP code injection via `{% use %}` template name","id":"CVE-2026-46633","kev_date_added":null,"published":"2026-07-14"},{"cvss_score":8.7,"headline":"Twig: Arbitrary PHP code execution via `_self.(\u003cstring\u003e)` macro-reference compilation","id":"CVE-2026-46640","kev_date_added":null,"published":"2026-07-14"},{"cvss_score":8.7,"headline":"Twig 2.16.x \u0026 3.9.0-3.25.x Sandbox Bypass via SourcePolicyInterface","id":"CVE-2026-24425","kev_date_added":null,"published":"2026-05-20"},{"cvss_score":8.6,"headline":"Twig has a possible sandbox bypass","id":"CVE-2024-45411","kev_date_added":null,"published":"2024-09-09"},{"cvss_score":7.7,"headline":"Twig: `template_from_string()` escapes a SourcePolicy-driven sandbox via synthesized template name","id":"CVE-2026-46634","kev_date_added":null,"published":"2026-07-14"},{"cvss_score":7.5,"headline":"Information disclosure in n/a","id":"CVE-2001-1537","kev_date_added":null,"published":"2005-07-14"}],"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":"partial"},"state":"PUBLISHED","updated":"2026-07-16","vendors":["twig","twigphp"]},"summary":"Attackers can inject malicious scripts via Twig markdown or CSS inliner filters due to incorrect safe output declarations, leading to XSS.","url":"https://insights.sbomify.com/CVE-2026-46637/"}