CVE-2025-27516
Publication date 6 March 2025
Last updated 12 March 2025
Ubuntu priority
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.
Status
Package | Ubuntu Release | Status |
---|---|---|
jinja2 | 24.10 oracular |
Fixed 3.1.3-1ubuntu1.24.10.2
|
24.04 LTS noble |
Fixed 3.1.2-1ubuntu1.3
|
|
22.04 LTS jammy |
Fixed 3.0.3-1ubuntu0.4
|
|
20.04 LTS focal |
Fixed 2.10.1-2ubuntu0.5
|
|
18.04 LTS bionic |
Fixed 2.10-1ubuntu0.18.04.1+esm4
|
|
16.04 LTS xenial |
Fixed 2.8-1ubuntu0.1+esm5
|
Get expanded security coverage with Ubuntu Pro
Reduce your average CVE exposure time from 98 days to 1 day with expanded CVE patching, ten-years security maintenance and optional support for the full stack of open-source applications. Free for personal use.
Get Ubuntu ProReferences
Related Ubuntu Security Notices (USN)
- USN-7343-1
- Jinja2 vulnerabilities
- 11 March 2025