Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CVE-2025-27516 in Jinja2 #919

Open
kristapsbriks opened this issue Mar 10, 2025 · 1 comment
Open

CVE-2025-27516 in Jinja2 #919

kristapsbriks opened this issue Mar 10, 2025 · 1 comment

Comments

@kristapsbriks
Copy link

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.

The security vulnerability (CVE-2025-27516) exists in Jinja2 version 3.1.5, which was identified on security scan through the following dependency chain:

  1. magento2-functional-testing-framework
  2. csharpru/vault-php (^4.2.1)
  3. sphinx_rtd_theme (documentation theme)
  4. jinja2-3.1.5-py3-none-any.whl (the vulnerable component)
Copy link

m2-assistant bot commented Mar 10, 2025

Hi @kristapsbriks. Thank you for your report.
To speed up processing of this issue, make sure that you provided sufficient information.
Add a comment to assign the issue: @magento I am working on this


Join Magento Community Engineering Slack and ask your questions in #github channel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant