Affected versions
Version ranges need review.
PyPIjinja2
- Affected versions
- <3.1.6 || =2.0 || =2.0rc1 || =2.1 || =2.1.1 || =2.10 || =2.10.1 || =2.10.2 || =2.10.3 || =2.11.0 || =2.11.1 || =2.11.2 || =2.11.3 || =2.2 || =2.2.1 || =2.3 || =2.3.1 || =2.4 || =2.4.1 || =2.5 || =2.5.1 || =2.5.2 || =2.5.3 || =2.5.4 || =2.5.5 || =2.6 || =2.7 || =2.7.1 || =2.7.2 || =2.7.3 || =2.8 || =2.8.1 || =2.9 || =2.9.1 || =2.9.2 || =2.9.3 || =2.9.4 || =2.9.5 || =2.9.6 || =3.0.0 || =3.0.0a1 || =3.0.0rc1 || =3.0.0rc2 || =3.0.1 || =3.0.2 || =3.0.3 || =3.1.0 || =3.1.1 || =3.1.2 || =3.1.3 || =3.1.4 || =3.1.5
- Fixed version
- 3.1.6
PyPIjinja2
- Affected versions
- <= 3.1.5
- Fixed version
- 3.1.6
- Affected versions
- Unknown
- Fixed version
- Not reported
- Affected versions
- Unknown
- Fixed version
- Not reported
- Affected versions
- Unknown
- Fixed version
- Not reported
- Affected versions
- Unknown
- Fixed version
- Not reported
- Affected versions
- Unknown
- Fixed version
- Not reported
- Affected versions
- Unknown
- Fixed version
- Not reported
- Affected versions
- Unknown
- Fixed version
- Not reported
- Affected versions
- Unknown
- Fixed version
- Not reported
- Affected versions
- Unknown
- Fixed version
- Not reported
- Affected versions
- Unknown
- Fixed version
- Not reported
- Affected versions
- Unknown
- Fixed version
- Not reported
- Affected versions
- Unknown
- Fixed version
- Not reported
- Affected versions
- Unknown
- Fixed version
- Not reported
- Affected versions
- Unknown
- Fixed version
- Not reported
- Affected versions
- Unknown
- Fixed version
- Not reported
- Affected versions
- Unknown
- Fixed version
- Not reported
- Affected versions
- Unknown
- Fixed version
- Not reported
- Affected versions
- Unknown
- Fixed version
- Not reported
- Affected versions
- Unknown
- Fixed version
- Not reported
- Affected versions
- Unknown
- Fixed version
- Not reported
Exploitation
Description
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.
Links
- https://github.com/advisories/GHSA-cpwx-vrp4-4pq7
- https://github.com/pallets/jinja
- https://github.com/pallets/jinja/commit/90457bbf33b8662926ae65cdde4c4c32e756e403
- https://github.com/pallets/jinja/releases/tag/3.1.6
- https://github.com/pallets/jinja/security/advisories/GHSA-cpwx-vrp4-4pq7
- https://github.com/pypa/advisory-database/tree/main/vulns/jinja2/PYSEC-2026-1471.yaml
- https://lists.debian.org/debian-lts-announce/2025/04/msg00022.html
- https://lists.debian.org/debian-lts-announce/2025/04/msg00045.html
- https://nvd.nist.gov/vuln/detail/CVE-2025-27516
- https://pypi.org/project/jinja2
Credits
- securingapps
- aungzayyanaing

