magento / magento/magento2-functional-testing-framework

CVE-2025-27516 in Jinja2

Open
#919 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
154
Forks
134
PR merge metrics
No merged PRs in 30d

Description

[CVE-2025-27516:](https://nvd.nist.gov/vuln/detail/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)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the listed dependency chain from magento2-functional-testing-framework through csharpru/vault-php and sphinx_rtd_theme to Jinja2 3.1.5. Confirm where the vulnerable version is introduced and verify that the completed change removes the CVE-2025-27516 finding by using the fixed Jinja version.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, python
Domain
devops, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.