{"answers":{"affected":"2 open source packages ship an affected version, including twig/twig.","exploited":"There is no known exploitation of CVE-2025-24374 in the wild and no public exploit code.","fix":"Upgrade twig/twig to 3.19.0 or later.","what":"CVE-2025-24374 is a medium-severity cross-site scripting vulnerability in twigphp Twig, published on 29 Jan 2025. 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-2025-24374 and fix it if it is affected.\n\nWhat it is: CVE-2025-24374 is a medium-severity cross-site scripting vulnerability in twigphp Twig, published on 29 Jan 2025. 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-2025-24374 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- twig/twig (Packagist): affected from 3.16.0; fixed in 3.19.0\n- twig/twig (Packagist): affected from 3.16.0; fixed in 3.19.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-2025-24374/ (Markdown: https://insights.sbomify.com/CVE-2025-24374/index.md)","id":"CVE-2025-24374","markdown":"https://insights.sbomify.com/CVE-2025-24374/index.md","name":"CVE-2025-24374","record":{"aliases":["DEBIAN-CVE-2025-24374","GHSA-3xg3-cgvq-2xwr","UBUNTU-CVE-2025-24374"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"PHP template engine","requires_auth":"none","summary":"Missing output escaping in Twig's null coalesce operator allows attackers to inject malicious scripts, potentially leading to cross-site scripting attacks.","user_interaction":"required","vuln_class":"xss"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[],"cvss":{"score":4.3,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N","version":"3.1"},"cwes":[{"id":"CWE-74","name":"Improper Neutralization of Special Elements in Output Used by a Downstream Component"}],"description":"Twig is a template language for PHP. When using the ?? operator, output escaping was missing for the expression on the left side of the operator. This vulnerability is fixed in 3.19.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 fixes a security issue where escaping was missing when using null coalesce operator (??)","id":"CVE-2025-24374","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Packagist","product":null,"products":[],"type":"xss","year":"2025"},"n_packages":2,"n_references":2,"next":{"headline":"MySQL K8s charm could leak credentials for root-level user `serverconfig`","id":"CVE-2025-24375"},"packages":[{"ecosystem":"Packagist","fixed":["3.19.0"],"introduced":["3.16.0"],"last_affected":[],"package":"twig/twig","purl":null,"source":"GHSA-3xg3-cgvq-2xwr"},{"ecosystem":"Packagist","fixed":["3.19.0"],"introduced":["3.16.0"],"last_affected":[],"package":"twig/twig","purl":"pkg:composer/twig/twig","source":"GHSA-3xg3-cgvq-2xwr"}],"prev":{"headline":"Unrestricted Access to PDF Documents via URL Manipulation in woocommerce-pdf-invoices-packing-slips","id":"CVE-2025-24373"},"products":["Twig"],"published":"2025-01-29","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":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-01-29","vendors":["twigphp"]},"summary":"Missing output escaping in Twig's null coalesce operator allows attackers to inject malicious scripts, potentially leading to cross-site scripting attacks.","url":"https://insights.sbomify.com/CVE-2025-24374/"}