CVE-2025-27516
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.
Description as published by the source, in English.
Key facts
- Published
- 2025-03-05
- Last modified
- 2026-06-17
- Assigned by
- security-advisories@github.com
- CVSS vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H- Scored by
- nvd@nist.gov (NVD Primary)
- Probability of exploitation
-
0.5 %
higher than 40 %
of all known vulnerabilities
EPSS, next 30 days, model v2026.06.15 - Fix available
- Yes, see references
Affected products
| Vendor | Product | Versions | Status |
|---|---|---|---|
| jinja2 (PyPI) | < 3.1.6 | Affected | |
| Debian | Debian Linux | 11.0 | Affected |
| Palletsprojects | Jinja | < 3.1.6 | Affected |
Weakness type
-
CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine
The product uses a template engine to insert or process externally-influenced input, but it does not neutralize or incorrectly neutralizes special elements or syntax that can be interpreted as template expressions or ot…
References
- https://github.com/pallets/jinja/commit/90457bbf33b8662926ae65cdde4c4c32e756e403
- https://github.com/pallets/jinja/security/advisories/GHSA-cpwx-vrp4-4pq7
- https://lists.debian.org/debian-lts-announce/2025/04/msg00045.html
- https://lists.debian.org/debian-lts-announce/2025/04/msg00022.html
Related at Berigo
Articles
-
An eighteen-year-old Linux kernel flaw hands ordinary users root
Same product
2026-08-08
Tencent Zhuque Lab has found a flaw in the SCTP part of the Linux kernel that has been there since 2008. An ordinary user can use it to gain root, an…
-
Bad Epoll grants root access in the Linux kernel
Same product
2026-07-03
CVE-2026-46242 is a use-after-free in the Linux kernel's epoll that lets an unprivileged process gain root on servers, desktops and Android devices.
-
Twelve-year-old PackageKit flaw affects widely used Linux distributions
Same product
2026-04-22
Deutsche Telekom's red team has found a CVSS 8.8 privilege escalation flaw in the PackageKit daemon, fixed in version 1.3.5.
-
CrackArmor: nine AppArmor flaws enable root access and container escape
Same product
2026-03-13
Qualys has disclosed nine AppArmor vulnerabilities dating back to 2017, affecting more than 12.6 million enterprise systems.
Does this affect you?
A vulnerability matters only if you run the product, in an affected version, somewhere an attacker can reach.