PT-2025-9857 · Jinja+11 · Jinja+11

Securingapps

·

Published

2025-03-05

·

Updated

2026-04-30

·

CVE-2025-27516

CVSS v3.1

8.8

High

VectorAV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Name of the Vulnerable Software and Affected Versions Jinja versions prior to 3.1.6
Description Jinja is an extensible templating engine. 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 issue, an attacker needs to control the content of a template, which depends on the type of application using Jinja. This issue impacts users of applications that execute untrusted templates. Jinja's sandbox catches 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.
Recommendations To resolve the issue, update to version 3.1.6 or later. As a temporary workaround, consider restricting the use of the |attr filter in templates until a patch is available. Avoid using the |attr filter to access sensitive attributes or methods in templates.

Exploit

Fix

DoS

Weakness Enumeration

Related Identifiers

ALSA-2025:3388
ALSA-2025:3406
ALSA-2025:7476
ALT-PU-2025-11958
ALT-PU-2025-12986
AZL-57800
AZL-57878
AZL-58063
AZL-58067
AZL-75804
BDU:2025-06562
CESA-2025_3388
CVE-2025-27516
DLA-4126-1
DLA-4126-2
ECHO-D102-C54D-3424
GHSA-CPWX-VRP4-4PQ7
INFSA-2025_3113
INFSA-2025_3388
INFSA-2025_3406
MGASA-2025-0094
OESA-2025-1529
OESA-2025-1530
OESA-2025-1531
OESA-2025-1532
OPENSUSE-SU-2025_0956-1
RHSA-2025:2688
RHSA-2025:3017
RHSA-2025:3111
RHSA-2025:3113
RHSA-2025:3123
RHSA-2025:3160
RHSA-2025:3371
RHSA-2025:3388
RHSA-2025:3406
RHSA-2025:3562
RHSA-2025:3580
RHSA-2025:3585
RHSA-2025:3586
RHSA-2025:3588
RHSA-2025:3622
RHSA-2025:3671
RHSA-2025:7476
RHSA-2025_3113
RHSA-2025_3388
RHSA-2025_3406
SUSE-SU-2025:0956-1
SUSE-SU-2025:1004-1
SUSE-SU-2025:1004-2
SUSE-SU-2025:20156-1
SUSE-SU-2025:20254-1
SUSE-SU-2025_0956-1
SUSE-SU-2025_1004-1
SUSE-SU-2025_1004-2
USN-7343-1
USN-7343-2

Affected Products

Alt Linux
Almalinux
Astra Linux
Centos
Debian
Jinja
Linuxmint
Red Hat
Red Os
Rocky Linux
Suse
Ubuntu