{"answers":{"affected":"3 open source packages ship an affected version, including jinja2 and Jinja2. It affects 2 products.","exploited":"There is no known exploitation of CVE-2025-27516 in the wild and no public exploit code.","fix":"Upgrade jinja2 to 3.1.6 or later.","what":"CVE-2025-27516 is a medium-severity code injection vulnerability in Debian Debian Linux, published on 5 Mar 2025. 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-2025-27516 and fix it if it is affected.\n\nWhat it is: CVE-2025-27516 is a medium-severity code injection vulnerability in Debian Debian Linux, published on 5 Mar 2025. 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-2025-27516 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- jinja2 (PyPI): affected all versions; fixed in 3.1.6\n- jinja2 (PyPI): affected all versions; fixed in 3.1.6\n- Jinja2 (PyPI): affected all versions; fixed in 3.1.6\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-27516/ (Markdown: https://insights.sbomify.com/CVE-2025-27516/index.md)","id":"CVE-2025-27516","markdown":"https://insights.sbomify.com/CVE-2025-27516/index.md","name":"CVE-2025-27516","record":{"aliases":["ALPINE-CVE-2025-27516","ALSA-2025:3388","ALSA-2025:3406","ALSA-2025:7476","AZL-57800","AZL-57878","AZL-58063","AZL-58067","AZL-75804","BELL-CVE-2025-27516","CLEANSTART-2026-DG23203","CLEANSTART-2026-RA96776","CLSA-2026-1790708389","CLSA-2026-1790708982","DEBIAN-CVE-2025-27516","ECHO-d102-c54d-3424","GHSA-cpwx-vrp4-4pq7","MGASA-2025-0094","MINI-3jgv-65v6-p6xm","MINI-4c5h-cmcm-mv5q","OESA-2025-1529","OESA-2025-1530","OESA-2025-1531","OESA-2025-1532","PYSEC-2026-1471","RHSA-2025:2688","RHSA-2025:3017","RHSA-2025:3111","RHSA-2025:3113","RHSA-2025:3123","RHSA-2025:3371","RHSA-2025:3388","RHSA-2025:3406","RHSA-2025:3562","RHSA-2025:3580","RHSA-2025:3585","RHSA-2025:3586","RHSA-2025:3588","RHSA-2025:3622","RHSA-2025:3671","RHSA-2025:7476","RHSA-2026:43940","RLSA-2025:3113","RLSA-2025:3388","RLSA-2025:3406","RLSA-2025:7476","ROOT-APP-PYPI-CVE-2025-27516","SUSE-SU-2025:0956-1","SUSE-SU-2025:1004-1","SUSE-SU-2025:1004-2","SUSE-SU-2025:20156-1","UBUNTU-CVE-2025-27516"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"Python templating library","requires_auth":"low_privilege","summary":"Attackers controlling template content can execute arbitrary Python code by bypassing the Jinja sandbox via the attr filter.","user_interaction":"required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"debian_linux","vendor":"debian"},{"product":"jinja","vendor":"palletsprojects"}],"cvss":{"score":5.4,"severity":"medium","source":"cna","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","version":"4.0"},"cwes":[{"id":"CWE-1336","name":"Improper Neutralization of Special Elements Used in a Template Engine"}],"description":"Jinja is an extensible templating engine. Prior to 3.1.6, an oversight in how the Jinja sandboxed environment interacts with the |attr filter allows an attacker that controls the content of a template to execute arbitrary Python code. To exploit the vulnerability, an attacker needs to control the content of a template. Whether that is the case depends on the type of application using Jinja. This vulnerability impacts users of applications which execute untrusted templates. Jinja's sandbox does catch calls to str.format and ensures they don't escape the sandbox. However, it's possible to use the |attr filter to get a reference to a string's plain format method, bypassing the sandbox. After the fix, the |attr filter no longer bypasses the environment's attribute lookup. This vulnerability is fixed in 3.1.6.","ecosystems":["AlmaLinux:10","AlmaLinux:8","AlmaLinux:9","PyPI","Red Hat:ansible_automation_platform:2.4::el8","Red Hat:ansible_automation_platform:2.4::el9","Red Hat:ansible_automation_platform_developer:2.4::el8","Red Hat:ansible_automation_platform_developer:2.4::el9","Red Hat:ansible_automation_platform_inside:2.4::el8","Red Hat:ansible_automation_platform_inside:2.4::el9","Red Hat:enterprise_linux:10.0","Red Hat:enterprise_linux:8::appstream","Red Hat:enterprise_linux:9::appstream","Red Hat:enterprise_linux:9::highavailability","Red Hat:enterprise_linux:9::resilientstorage","Red Hat:hummingbird:1","Red Hat:openstack:17.1::el9","Red Hat:rhel_aus:8.2::appstream","Red Hat:rhel_aus:8.4::appstream","Red Hat:rhel_aus:8.6::appstream","Red Hat:rhel_e4s:8.4::appstream","Red Hat:rhel_e4s:8.6::appstream","Red Hat:rhel_e4s:9.0::appstream","Red Hat:rhel_e4s:9.0::highavailability","Red Hat:rhel_e4s:9.0::resilientstorage","Red Hat:rhel_eus:8.8::appstream","Red Hat:rhel_eus:9.2::appstream","Red Hat:rhel_eus:9.2::highavailability","Red Hat:rhel_eus:9.2::resilientstorage","Red Hat:rhel_eus:9.4::appstream","Red Hat:rhel_eus:9.4::highavailability","Red Hat:rhel_eus:9.4::resilientstorage","Red Hat:rhel_tus:8.4::appstream","Red Hat:rhel_tus:8.6::appstream","Rocky Linux:10","Rocky Linux:8","Rocky Linux:9","SUSE:Enterprise Storage 7.1","SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS","SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS","SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS","SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS","SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS","SUSE:Linux Enterprise Micro 5.1","SUSE:Linux Enterprise Micro 5.2","SUSE:Linux Enterprise Micro 5.3","SUSE:Linux Enterprise Micro 5.4","SUSE:Linux Enterprise Micro 5.5","SUSE:Linux Enterprise Module for Basesystem 15 SP6","SUSE:Linux Enterprise Module for Public Cloud 15 SP4","SUSE:Linux Enterprise Module for Python 3 15 SP6","SUSE:Linux Enterprise Server 15 SP3-LTSS","SUSE:Linux Enterprise Server 15 SP4-LTSS","SUSE:Linux Enterprise Server 15 SP5-LTSS","SUSE:Linux Enterprise Server for SAP Applications 15 SP3","SUSE:Linux Enterprise Server for SAP Applications 15 SP4","SUSE:Linux Enterprise Server for SAP Applications 15 SP5","SUSE:Linux Micro 6.0","openSUSE:Leap 15.6"],"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":"Jinja sandbox breakout through attr filter selecting format method","id":"CVE-2025-27516","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":"debian:debian_linux","products":["debian:debian_linux"],"type":"code_injection","year":"2025"},"n_packages":620,"n_references":2,"next":{"headline":"Volt Allows RCE Via User-Crafted Requests","id":"CVE-2025-27517"},"packages":[{"ecosystem":"PyPI","fixed":["3.1.6"],"introduced":["0"],"last_affected":[],"package":"Jinja2","purl":null,"source":"GHSA-cpwx-vrp4-4pq7"},{"ecosystem":"PyPI","fixed":["3.1.6"],"introduced":["0"],"last_affected":[],"package":"jinja2","purl":"pkg:pypi/jinja2","source":"GHSA-cpwx-vrp4-4pq7"},{"ecosystem":"PyPI","fixed":["3.1.6"],"introduced":["0"],"last_affected":[],"package":"jinja2","purl":"pkg:pypi/jinja2","source":"PYSEC-2026-1471"},{"ecosystem":"AlmaLinux:10","fixed":["3.1.6-1.el10_0"],"introduced":["0"],"last_affected":[],"package":"python3-jinja2","purl":"pkg:rpm/almalinux/python3-jinja2","source":"ALSA-2025:7476"},{"ecosystem":"AlmaLinux:10","fixed":["3.1.6-1.el10_0"],"introduced":["0"],"last_affected":[],"package":"python3-jinja2+i18n","purl":"pkg:rpm/almalinux/python3-jinja2%2Bi18n","source":"ALSA-2025:7476"},{"ecosystem":"AlmaLinux:8","fixed":["2.10.1-7.el8_10"],"introduced":["0"],"last_affected":[],"package":"python3-jinja2","purl":"pkg:rpm/almalinux/python3-jinja2","source":"ALSA-2025:3388"},{"ecosystem":"AlmaLinux:9","fixed":["2.11.3-8.el9_5"],"introduced":["0"],"last_affected":[],"package":"python3-jinja2","purl":"pkg:rpm/almalinux/python3-jinja2","source":"ALSA-2025:3406"},{"ecosystem":"Red Hat:ansible_automation_platform:2.4::el8","fixed":["0:4.5.20-1.el8ap"],"introduced":["0"],"last_affected":[],"package":"automation-controller-venv-tower","purl":"pkg:rpm/redhat/automation-controller-venv-tower","source":"RHSA-2025:3123"},{"ecosystem":"Red Hat:ansible_automation_platform:2.4::el8","fixed":["0:3.1.6-1.el8ap"],"introduced":["0"],"last_affected":[],"package":"python39-jinja2","purl":"pkg:rpm/redhat/python39-jinja2","source":"RHSA-2025:3123"},{"ecosystem":"Red Hat:ansible_automation_platform:2.4::el8","fixed":["0:3.1.6-1.el8ap"],"introduced":["0"],"last_affected":[],"package":"python3x-jinja2","purl":"pkg:rpm/redhat/python3x-jinja2","source":"RHSA-2025:3123"},{"ecosystem":"Red Hat:ansible_automation_platform:2.4::el9","fixed":["0:4.5.20-1.el9ap"],"introduced":["0"],"last_affected":[],"package":"automation-controller-venv-tower","purl":"pkg:rpm/redhat/automation-controller-venv-tower","source":"RHSA-2025:3123"},{"ecosystem":"Red Hat:ansible_automation_platform:2.4::el9","fixed":["0:3.1.6-1.el9ap"],"introduced":["0"],"last_affected":[],"package":"python-jinja2","purl":"pkg:rpm/redhat/python-jinja2","source":"RHSA-2025:3123"},{"ecosystem":"Red Hat:ansible_automation_platform:2.4::el9","fixed":["0:3.1.6-1.el9ap"],"introduced":["0"],"last_affected":[],"package":"python3-jinja2","purl":"pkg:rpm/redhat/python3-jinja2","source":"RHSA-2025:3123"},{"ecosystem":"Red Hat:ansible_automation_platform_developer:2.4::el8","fixed":["0:3.1.6-1.el8ap"],"introduced":["0"],"last_affected":[],"package":"python39-jinja2","purl":"pkg:rpm/redhat/python39-jinja2","source":"RHSA-2025:3123"},{"ecosystem":"Red Hat:ansible_automation_platform_developer:2.4::el8","fixed":["0:3.1.6-1.el8ap"],"introduced":["0"],"last_affected":[],"package":"python3x-jinja2","purl":"pkg:rpm/redhat/python3x-jinja2","source":"RHSA-2025:3123"},{"ecosystem":"Red Hat:ansible_automation_platform_developer:2.4::el9","fixed":["0:3.1.6-1.el9ap"],"introduced":["0"],"last_affected":[],"package":"python-jinja2","purl":"pkg:rpm/redhat/python-jinja2","source":"RHSA-2025:3123"},{"ecosystem":"Red Hat:ansible_automation_platform_developer:2.4::el9","fixed":["0:3.1.6-1.el9ap"],"introduced":["0"],"last_affected":[],"package":"python3-jinja2","purl":"pkg:rpm/redhat/python3-jinja2","source":"RHSA-2025:3123"},{"ecosystem":"Red Hat:ansible_automation_platform_inside:2.4::el8","fixed":["0:3.1.6-1.el8ap"],"introduced":["0"],"last_affected":[],"package":"python39-jinja2","purl":"pkg:rpm/redhat/python39-jinja2","source":"RHSA-2025:3123"},{"ecosystem":"Red Hat:ansible_automation_platform_inside:2.4::el8","fixed":["0:3.1.6-1.el8ap"],"introduced":["0"],"last_affected":[],"package":"python3x-jinja2","purl":"pkg:rpm/redhat/python3x-jinja2","source":"RHSA-2025:3123"},{"ecosystem":"Red Hat:ansible_automation_platform_inside:2.4::el9","fixed":["0:3.1.6-1.el9ap"],"introduced":["0"],"last_affected":[],"package":"python-jinja2","purl":"pkg:rpm/redhat/python-jinja2","source":"RHSA-2025:3123"},{"ecosystem":"Red Hat:ansible_automation_platform_inside:2.4::el9","fixed":["0:3.1.6-1.el9ap"],"introduced":["0"],"last_affected":[],"package":"python3-jinja2","purl":"pkg:rpm/redhat/python3-jinja2","source":"RHSA-2025:3123"},{"ecosystem":"Red Hat:enterprise_linux:10.0","fixed":["0:3.1.6-1.el10_0"],"introduced":["0"],"last_affected":[],"package":"python-jinja2","purl":"pkg:rpm/redhat/python-jinja2","source":"RHSA-2025:7476"},{"ecosystem":"Red Hat:enterprise_linux:10.0","fixed":["0:3.1.6-1.el10_0"],"introduced":["0"],"last_affected":[],"package":"python3-jinja2","purl":"pkg:rpm/redhat/python3-jinja2","source":"RHSA-2025:7476"},{"ecosystem":"Red Hat:enterprise_linux:10.0","fixed":["0:3.1.6-1.el10_0"],"introduced":["0"],"last_affected":[],"package":"python3-jinja2+i18n","purl":"pkg:rpm/redhat/python3-jinja2%2Bi18n","source":"RHSA-2025:7476"},{"ecosystem":"Red Hat:enterprise_linux:8::appstream","fixed":["0:2.10.1-7.el8_10"],"introduced":["0"],"last_affected":[],"package":"python-jinja2","purl":"pkg:rpm/redhat/python-jinja2","source":"RHSA-2025:3388"},{"ecosystem":"Red Hat:enterprise_linux:8::appstream","fixed":["0:2.10.1-7.el8_10"],"introduced":["0"],"last_affected":[],"package":"python3-jinja2","purl":"pkg:rpm/redhat/python3-jinja2","source":"RHSA-2025:3388"},{"ecosystem":"Red Hat:enterprise_linux:9::appstream","fixed":["0:4.10.0-76.el9_5.6"],"introduced":["0"],"last_affected":[],"package":"fence-agents","purl":"pkg:rpm/redhat/fence-agents","source":"RHSA-2025:3113"},{"ecosystem":"Red Hat:enterprise_linux:9::appstream","fixed":["0:4.10.0-76.el9_5.6"],"introduced":["0"],"last_affected":[],"package":"fence-agents-common","purl":"pkg:rpm/redhat/fence-agents-common","source":"RHSA-2025:3113"},{"ecosystem":"Red Hat:enterprise_linux:9::appstream","fixed":["0:4.10.0-76.el9_5.6"],"introduced":["0"],"last_affected":[],"package":"fence-agents-compute","purl":"pkg:rpm/redhat/fence-agents-compute","source":"RHSA-2025:3113"},{"ecosystem":"Red Hat:enterprise_linux:9::appstream","fixed":["0:4.10.0-76.el9_5.6"],"introduced":["0"],"last_affected":[],"package":"fence-agents-debuginfo","purl":"pkg:rpm/redhat/fence-agents-debuginfo","source":"RHSA-2025:3113"},{"ecosystem":"Red Hat:enterprise_linux:9::appstream","fixed":["0:4.10.0-76.el9_5.6"],"introduced":["0"],"last_affected":[],"package":"fence-agents-debugsource","purl":"pkg:rpm/redhat/fence-agents-debugsource","source":"RHSA-2025:3113"},{"ecosystem":"Red Hat:enterprise_linux:9::appstream","fixed":["0:4.10.0-76.el9_5.6"],"introduced":["0"],"last_affected":[],"package":"fence-agents-ibm-powervs","purl":"pkg:rpm/redhat/fence-agents-ibm-powervs","source":"RHSA-2025:3113"},{"ecosystem":"Red Hat:enterprise_linux:9::appstream","fixed":["0:4.10.0-76.el9_5.6"],"introduced":["0"],"last_affected":[],"package":"fence-agents-ibm-vpc","purl":"pkg:rpm/redhat/fence-agents-ibm-vpc","source":"RHSA-2025:3113"},{"ecosystem":"Red Hat:enterprise_linux:9::appstream","fixed":["0:4.10.0-76.el9_5.6"],"introduced":["0"],"last_affected":[],"package":"fence-agents-kdump-debuginfo","purl":"pkg:rpm/redhat/fence-agents-kdump-debuginfo","source":"RHSA-2025:3113"},{"ecosystem":"Red Hat:enterprise_linux:9::appstream","fixed":["0:4.10.0-76.el9_5.6"],"introduced":["0"],"last_affected":[],"package":"fence-agents-kubevirt","purl":"pkg:rpm/redhat/fence-agents-kubevirt","source":"RHSA-2025:3113"},{"ecosystem":"Red Hat:enterprise_linux:9::appstream","fixed":["0:4.10.0-76.el9_5.6"],"introduced":["0"],"last_affected":[],"package":"fence-agents-kubevirt-debuginfo","purl":"pkg:rpm/redhat/fence-agents-kubevirt-debuginfo","source":"RHSA-2025:3113"},{"ecosystem":"Red Hat:enterprise_linux:9::appstream","fixed":["0:4.10.0-76.el9_5.6"],"introduced":["0"],"last_affected":[],"package":"fence-agents-virsh","purl":"pkg:rpm/redhat/fence-agents-virsh","source":"RHSA-2025:3113"},{"ecosystem":"Red Hat:enterprise_linux:9::appstream","fixed":["0:4.10.0-76.el9_5.6"],"introduced":["0"],"last_affected":[],"package":"fence-virt","purl":"pkg:rpm/redhat/fence-virt","source":"RHSA-2025:3113"},{"ecosystem":"Red Hat:enterprise_linux:9::appstream","fixed":["0:4.10.0-76.el9_5.6"],"introduced":["0"],"last_affected":[],"package":"fence-virt-debuginfo","purl":"pkg:rpm/redhat/fence-virt-debuginfo","source":"RHSA-2025:3113"},{"ecosystem":"Red Hat:enterprise_linux:9::appstream","fixed":["0:4.10.0-76.el9_5.6"],"introduced":["0"],"last_affected":[],"package":"fence-virtd","purl":"pkg:rpm/redhat/fence-virtd","source":"RHSA-2025:3113"}],"prev":{"headline":"Laravel has a File Validation Bypass","id":"CVE-2025-27515"},"products":["jinja"],"published":"2025-03-05","related":[{"cvss_score":10,"headline":"ProFTPD Improper Access Control","id":"CVE-2015-3306","kev_date_added":"2026-10-08","published":"2015-05-18"},{"cvss_score":9.9,"headline":"RoundCube Webmail Deserialization of Untrusted Data","id":"CVE-2025-49113","kev_date_added":"2026-02-20","published":"2025-06-02"},{"cvss_score":9.8,"headline":"GNU InetUtils Argument Injection","id":"CVE-2026-24061","kev_date_added":"2026-01-26","published":"2026-01-21"},{"cvss_score":9.8,"headline":"Linux Kernel Improper Check for Unusual or Exceptional Conditions","id":"CVE-2025-39682","kev_date_added":"2026-09-18","published":"2025-09-05"},{"cvss_score":9.8,"headline":"Mozilla Firefox Use-After-Free","id":"CVE-2024-9680","kev_date_added":"2024-10-15","published":"2024-10-09"},{"cvss_score":9.8,"headline":"RARLAB UnRAR Directory Traversal","id":"CVE-2022-30333","kev_date_added":"2022-08-09","published":"2022-05-09"},{"cvss_score":9.8,"headline":"Roundcube Webmail SQL Injection","id":"CVE-2021-44026","kev_date_added":"2023-06-22","published":"2021-11-19"}],"sources":[{"class":"attribution","licence":"MIT","name":"AlmaLinux","prefix":"ALSA"},{"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":"CC BY 4.0","name":"Red Hat","prefix":"RHSA"},{"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":"2026-02-26","vendors":["pallets"]},"summary":"Attackers controlling template content can execute arbitrary Python code by bypassing the Jinja sandbox via the attr filter.","url":"https://insights.sbomify.com/CVE-2025-27516/"}