TEST-INFRA: [dependency-security] Vulnerabilities in Jinja2 3.1.0 #6067

Open
opened 2026-04-09 14:21:11 +00:00 by HAL9000 · 0 comments
Owner

Metadata

  • Branch: fix/jinja2-dependency-security-upgrade
  • Commit Message: fix(deps): upgrade Jinja2 to 3.1.6 to resolve multiple CVEs
  • Milestone: (backlog — see note below)
  • Parent Epic: #362

Summary

A security scan has identified multiple vulnerabilities in Jinja2 version 3.1.0, which is a dependency of this project. These vulnerabilities could allow an attacker to bypass the sandbox and execute arbitrary code, or perform Cross-Site Scripting (XSS) attacks.

Vulnerability Details

1. HTML Attribute Injection (CVE-2024-22195, GHSA-h5c8-rqwp-cp95)

  • Severity: MODERATE
  • Description: The xmlattr filter in affected versions of Jinja accepts keys containing spaces, which can lead to HTML attribute injection and XSS.
  • Affected Versions: All versions before 3.1.3
  • Patched Version: 3.1.3

2. HTML Attribute Injection (CVE-2024-34064, GHSA-h75v-3vvj-5mfj)

  • Severity: MODERATE
  • Description: The xmlattr filter in affected versions of Jinja accepts keys containing non-attribute characters, which can lead to HTML attribute injection and XSS.
  • Affected Versions: All versions before 3.1.4
  • Patched Version: 3.1.4

3. Sandbox Breakout via Malicious Filenames (CVE-2024-56201, GHSA-gmj6-6f8f-6699)

  • Severity: MODERATE
  • Description: A bug in the Jinja compiler allows an attacker that controls both the content and filename of a template to execute arbitrary Python code, regardless of if Jinja's sandbox is used.
  • Affected Versions: 3.0.0 to 3.1.4
  • Patched Version: 3.1.5

4. Sandbox Breakout via Indirect Reference to Format Method (CVE-2024-56326, GHSA-q2x7-8rv6-6q7h)

  • Severity: MODERATE
  • Description: An oversight in how the Jinja sandboxed environment detects calls to str.format allows an attacker that controls the content of a template to execute arbitrary Python code.
  • Affected Versions: All versions before 3.1.5
  • Patched Version: 3.1.5

5. Sandbox Breakout via attr Filter (CVE-2025-27516, GHSA-cpwx-vrp4-4pq7)

  • Severity: MODERATE
  • 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.
  • Affected Versions: All versions before 3.1.6
  • Patched Version: 3.1.6

Subtasks

  • Identify all locations where Jinja2 is declared as a dependency (e.g., pyproject.toml, requirements*.txt, noxfile.py)
  • Upgrade Jinja2 minimum version constraint to >=3.1.6 in all relevant dependency files
  • Run uv lock / pip-compile to regenerate lockfiles with the updated constraint
  • Verify no other dependency pins an older conflicting version of Jinja2
  • Run the full test suite (nox) to confirm no regressions
  • Confirm coverage remains >= 97%

Definition of Done

  • Jinja2 version in all dependency files is constrained to >=3.1.6
  • Lockfiles are regenerated and committed
  • All five CVEs (CVE-2024-22195, CVE-2024-34064, CVE-2024-56201, CVE-2024-56326, CVE-2025-27516) are resolved by the upgraded version
  • All nox stages pass
  • Coverage >= 97%
  • PR merged and issue closed

Backlog note: This issue was discovered during autonomous operation
on milestone v3.3.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.


Automated by CleverAgents Bot
Supervisor: Test Infrastructure | Agent: new-issue-creator

## Metadata - **Branch**: `fix/jinja2-dependency-security-upgrade` - **Commit Message**: `fix(deps): upgrade Jinja2 to 3.1.6 to resolve multiple CVEs` - **Milestone**: *(backlog — see note below)* - **Parent Epic**: #362 ## Summary A security scan has identified multiple vulnerabilities in `Jinja2` version `3.1.0`, which is a dependency of this project. These vulnerabilities could allow an attacker to bypass the sandbox and execute arbitrary code, or perform Cross-Site Scripting (XSS) attacks. ## Vulnerability Details ### 1. HTML Attribute Injection (CVE-2024-22195, GHSA-h5c8-rqwp-cp95) - **Severity:** MODERATE - **Description:** The `xmlattr` filter in affected versions of Jinja accepts keys containing spaces, which can lead to HTML attribute injection and XSS. - **Affected Versions:** All versions before `3.1.3` - **Patched Version:** `3.1.3` ### 2. HTML Attribute Injection (CVE-2024-34064, GHSA-h75v-3vvj-5mfj) - **Severity:** MODERATE - **Description:** The `xmlattr` filter in affected versions of Jinja accepts keys containing non-attribute characters, which can lead to HTML attribute injection and XSS. - **Affected Versions:** All versions before `3.1.4` - **Patched Version:** `3.1.4` ### 3. Sandbox Breakout via Malicious Filenames (CVE-2024-56201, GHSA-gmj6-6f8f-6699) - **Severity:** MODERATE - **Description:** A bug in the Jinja compiler allows an attacker that controls both the content and filename of a template to execute arbitrary Python code, regardless of if Jinja's sandbox is used. - **Affected Versions:** `3.0.0` to `3.1.4` - **Patched Version:** `3.1.5` ### 4. Sandbox Breakout via Indirect Reference to Format Method (CVE-2024-56326, GHSA-q2x7-8rv6-6q7h) - **Severity:** MODERATE - **Description:** An oversight in how the Jinja sandboxed environment detects calls to `str.format` allows an attacker that controls the content of a template to execute arbitrary Python code. - **Affected Versions:** All versions before `3.1.5` - **Patched Version:** `3.1.5` ### 5. Sandbox Breakout via `attr` Filter (CVE-2025-27516, GHSA-cpwx-vrp4-4pq7) - **Severity:** MODERATE - **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. - **Affected Versions:** All versions before `3.1.6` - **Patched Version:** `3.1.6` ## Subtasks - [ ] Identify all locations where `Jinja2` is declared as a dependency (e.g., `pyproject.toml`, `requirements*.txt`, `noxfile.py`) - [ ] Upgrade `Jinja2` minimum version constraint to `>=3.1.6` in all relevant dependency files - [ ] Run `uv lock` / `pip-compile` to regenerate lockfiles with the updated constraint - [ ] Verify no other dependency pins an older conflicting version of Jinja2 - [ ] Run the full test suite (`nox`) to confirm no regressions - [ ] Confirm coverage remains >= 97% ## Definition of Done - [ ] `Jinja2` version in all dependency files is constrained to `>=3.1.6` - [ ] Lockfiles are regenerated and committed - [ ] All five CVEs (CVE-2024-22195, CVE-2024-34064, CVE-2024-56201, CVE-2024-56326, CVE-2025-27516) are resolved by the upgraded version - [ ] All nox stages pass - [ ] Coverage >= 97% - [ ] PR merged and issue closed > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.3.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure | Agent: new-issue-creator
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
#362 Epic: Security & Safety Hardening
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#6067
No description provided.