Vulnerability
CVE-2025-27516
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.
75 advisories report this vulnerability, across 15 ecosystems.
Advisories
-
ALAS2-2025-2792
Amazon Linux 2 2017.12 - ALAS2-2025-2792: important priority package update for python-jinja2
-
ALAS2-2025-2793
Amazon Linux 2 2017.12 - ALAS2-2025-2793: important priority package update for python3-jinja2
-
ALAS2023-2025-893
Amazon Linux 2023 - ALAS2023-2025-893: Important priority package update for ansible-core
-
ALAS2023-2025-894
Amazon Linux 2023 - ALAS2023-2025-894: Important priority package update for python-jinja2
-
ALPINE-CVE-2025-27516
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…
- ALPINE-EDGE-CVE-2025-27516
-
ALSA-2025:3388
Important: python-jinja2 security update
-
ALSA-2025:3406
Important: python-jinja2 security update
-
ALSA-2025:7476
Important: python-jinja2 security update
-
AZL-57800
CVE-2025-27516 affecting package python-jinja2 for versions less than 3.0.3-7
-
AZL-57878
CVE-2025-27516 affecting package python-jinja2 for versions less than 3.1.2-3
-
AZL-58063
CVE-2025-27516 affecting package nodejs18 for versions less than 18.20.3-5
-
AZL-58067
CVE-2025-27516 affecting package nodejs for versions less than 20.14.0-7
-
AZL-75804
CVE-2025-27516 affecting package nodejs24 for versions less than 24.13.0-1
- CGA-3pc7-pfwj-crpv
- CGA-3rmm-cjjw-m8xv
- CGA-3xpx-c9pp-cqf2
- CGA-42xf-hgm6-w46m
- CGA-4gm9-jrmv-4hxp
- CGA-73mx-2p2x-g6jq
- CGA-932m-9pv9-hp33
- CGA-9xg9-38c3-4rx5
- CGA-f3rx-5w9w-v7pw
- CGA-fxpp-5vv6-r37x
- CGA-g2cq-hqj3-gqc4
- CGA-grcq-mqx9-f476
- CGA-hghm-phh8-7jmp
- CGA-hv7v-v9hg-j8g5
- CGA-j5r4-8x66-fphw
- CGA-jw7f-qcqc-p9hh
- CGA-jxxh-cfr2-8hw5
- CGA-x22v-q4g7-w4h7
-
DEBIAN-CVE-2025-27516
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…
-
DLA-4126-1
jinja2 - security update
-
ELSA-2025-3113
ELSA-2025-3113: fence-agents security update (IMPORTANT)
-
ELSA-2025-3388
ELSA-2025-3388: python-jinja2 security update (IMPORTANT)
-
ELSA-2025-3406
ELSA-2025-3406: python-jinja2 security update (IMPORTANT)
-
ELSA-2025-7476
ELSA-2025-7476: python-jinja2 security update (IMPORTANT)
-
GHSA-cpwx-vrp4-4pq7
Jinja2 vulnerable to sandbox breakout through attr filter selecting format method
-
OESA-2025-1529
python-jinja2 security update
-
OESA-2025-1530
python-jinja2 security update
-
OESA-2025-1531
python-jinja2 security update
-
OESA-2025-1532
python-jinja2 security update
-
PYSEC-2026-1471
Jinja2 vulnerable to sandbox breakout through attr filter selecting format method
-
RHSA-2025:2688
Red Hat Security Advisory: fence-agents security update
-
RHSA-2025:3017
Red Hat Security Advisory: fence-agents security update
-
RHSA-2025:3111
Red Hat Security Advisory: fence-agents security update
-
RHSA-2025:3113
Red Hat Security Advisory: fence-agents security update
-
RHSA-2025:3123
Red Hat Security Advisory: Red Hat Ansible Automation Platform 2.4 Product Security and Bug Fix Update
-
RHSA-2025:3160
Red Hat Security Advisory: Red Hat Ansible Automation Platform 2.5 Product Security and Bug Fix Update
-
RHSA-2025:3371
Red Hat Security Advisory: Red Hat OpenStack Platform 17.1 (openstack-ansible-core) security update
-
RHSA-2025:3388
Red Hat Security Advisory: python-jinja2 security update
-
RHSA-2025:3406
Red Hat Security Advisory: python-jinja2 security update
-
RHSA-2025:3562
Red Hat Security Advisory: python-jinja2 security update
-
RHSA-2025:3580
Red Hat Security Advisory: python-jinja2 security update
-
RHSA-2025:3585
Red Hat Security Advisory: python-jinja2 security update
-
RHSA-2025:3586
Red Hat Security Advisory: python-jinja2 security update
-
RHSA-2025:3588
Red Hat Security Advisory: python-jinja2 security update
-
RHSA-2025:3622
Red Hat Security Advisory: python-jinja2 security update
-
RHSA-2025:3671
Red Hat Security Advisory: python-jinja2 security update
-
RHSA-2025:7476
Red Hat Security Advisory: python-jinja2 security update
-
RHSA-2026:43940
Red Hat Security Advisory: Red Hat Hardened Images RPMs bug fix and enhancement update
-
RHVEX-CVE-2025-27516
jinja2: Jinja sandbox breakout through attr filter selecting format method
-
RLSA-2025:3113
Important: fence-agents security update
-
RLSA-2025:3388
Important: python-jinja2 security update
-
RLSA-2025:3406
Important: python-jinja2 security update
-
RLSA-2025:7476
Important: python-jinja2 security update
-
SUSE-SU-2025:0956-1
Security update for python-Jinja2
-
SUSE-SU-2025:1004-1
Security update for python-Jinja2
-
SUSE-SU-2025:1004-2
Security update for python-Jinja2
-
SUSE-SU-2025:20156-1
Security update for python-Jinja2
-
SUSE-SU-2025:20254-1
Security update for python-Jinja2
-
SUSEVEX-CVE-2025-27516
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…
-
UBUNTU-CVE-2025-27516
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…
-
USN-7343-1
jinja2 vulnerabilities