Advisory

DEBIAN-CVE-2025-27516

Also known as: CVE-2025-27516

Summary

The record has no summary.

Details

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.

Severity

High Basis: CVSS v3 score 8.8, vector CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

Dates

Published
2025-03-05 21:15 UTC
Modified
2026-09-01 20:05 UTC

Affected packages and fixes

jinja2

Debian packages (deb) · Debian 12

Affected

  • introduced 0, fixed 3.1.2-1+deb12u3 (ecosystem)

Fixed versions

3.1.2-1+deb12u3

Fix

  • Fixed version 3.1.2-1+deb12u3
    sudo apt-get update && sudo apt-get upgrade

This command upgrades the distribution's packages. Compare the fixed version with the version you have installed.

jinja2

Debian packages (deb) · Debian 13

Affected

  • introduced 0, fixed 3.1.6-1 (ecosystem)

Fixed versions

3.1.6-1

Fix

  • Fixed version 3.1.6-1
    sudo apt-get update && sudo apt-get upgrade

This command upgrades the distribution's packages. Compare the fixed version with the version you have installed.

jinja2

Debian packages (deb) · Debian 14

Affected

  • introduced 0, fixed 3.1.6-1 (ecosystem)

Fixed versions

3.1.6-1

Fix

  • Fixed version 3.1.6-1
    sudo apt-get update && sudo apt-get upgrade

This command upgrades the distribution's packages. Compare the fixed version with the version you have installed.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: Debian Security Tracker (converted by OSV.dev)

Debian Security Tracker, converted to OSV by OSV.dev.

Sources & licences