Debian dla-4126 : python-jinja2 - security update

medium Nessus Plugin ID 234243

Synopsis

The remote Debian host is missing one or more security-related updates.

Description

The remote Debian 11 host has packages installed that are affected by multiple vulnerabilities as referenced in the dla-4126 advisory.

- ------------------------------------------------------------------------- Debian LTS Advisory DLA-4126-1 [email protected] https://www.debian.org/lts/security/ Lucas Kanashiro April 13, 2025 https://wiki.debian.org/LTS
- -------------------------------------------------------------------------

Package : jinja2 Version : 2.11.3-1+deb11u3 CVE ID : CVE-2024-56326 CVE-2025-27516 Debian Bug : #1091331, #1099690

A couple of vulnerabilities were found in jinja2, a template engine. The rendering of untrusted templates could lead to attackers executing arbitrary Python code.

CVE-2024-56326

Prior to 3.1.5, 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. 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 store a reference to a malicious string's format method, then pass that to a filter that calls it. No such filters are built-in to Jinja, but could be present through custom filters in an application. After the fix, such indirect calls are also handled by the sandbox.

CVE-2025-27516

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.

For Debian 11 bullseye, these problems have been fixed in version 2.11.3-1+deb11u3.

We recommend that you upgrade your jinja2 packages.

For the detailed security status of jinja2 please refer to its security tracker page at:
https://security-tracker.debian.org/tracker/jinja2

Further information about Debian LTS security advisories, how to apply these updates to your system and frequently asked questions can be found at: https://wiki.debian.org/LTS

Tenable has extracted the preceding description block directly from the Debian security advisory.

Note that Nessus has not tested for these issues but has instead relied only on the application's self-reported version number.

Solution

Upgrade the python-jinja2 packages.

See Also

https://security-tracker.debian.org/tracker/source-package/jinja2

https://security-tracker.debian.org/tracker/CVE-2024-56326

https://security-tracker.debian.org/tracker/CVE-2025-27516

https://packages.debian.org/source/bullseye/jinja2

Plugin Details

Severity: Medium

ID: 234243

File Name: debian_DLA-4126.nasl

Version: 1.1

Type: local

Agent: unix

Published: 4/13/2025

Updated: 4/13/2025

Supported Sensors: Frictionless Assessment Agent, Nessus Agent, Agentless Assessment, Continuous Assessment, Nessus

Risk Information

VPR

Risk Factor: Medium

Score: 6.7

CVSS v2

Risk Factor: High

Base Score: 7.6

Temporal Score: 5.6

Vector: CVSS2#AV:N/AC:H/Au:N/C:C/I:C/A:C

CVSS Score Source: CVE-2024-56326

CVSS v3

Risk Factor: High

Base Score: 7.8

Temporal Score: 6.8

Vector: CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Temporal Vector: CVSS:3.0/E:U/RL:O/RC:C

CVSS v4

Risk Factor: Medium

Base Score: 5.4

Threat Score: 2

Threat Vector: CVSS:4.0/E:U

Vector: CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

CVSS Score Source: CVE-2025-27516

Vulnerability Information

CPE: p-cpe:/a:debian:debian_linux:python-jinja2-doc, cpe:/o:debian:debian_linux:11.0, p-cpe:/a:debian:debian_linux:python-jinja2, p-cpe:/a:debian:debian_linux:python3-jinja2

Required KB Items: Host/local_checks_enabled, Host/Debian/release, Host/Debian/dpkg-l

Exploit Ease: No known exploits are available

Patch Publication Date: 4/13/2025

Vulnerability Publication Date: 12/21/2024

Reference Information

CVE: CVE-2024-56326, CVE-2025-27516