Skip to content
OpenAdvisories
High ALAS2-2025-2792 1 CVE

Important: python-jinja2 security update (Amazon Linux 2)

Published Mar 13, 2025 · Updated Mar 25, 2025

Summary

Package updates are available for Amazon Linux 2 that fix the following vulnerabilities: 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.

Fixed packages 1

ReleasePackageFixed in
Amazon Linux · 2 python-jinja2 0:2.7.2-3.amzn2.0.4

Vulnerabilities 1

  • Medium 5.4

    Jinja sandbox breakout through attr filter selecting format method

    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 vulnerabi…

References

  • web
    https://alas.aws.amazon.com/cve/html/CVE-2025-27516.html