CVE-2024-56201

Jinja has a sandbox breakout through malicious filenames

Published Dec 23, 2024 CVSS 4.0 · 5.4 Medium EPSS < 1% KEV · Not listed
Description
Jinja is an extensible templating engine. In versions on the 3.x branch prior to 3.1.5, 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. To exploit the vulnerability, an attacker needs to control both the filename and the contents 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 where the template author can also choose the template filename. This vulnerability is fixed in 3.1.5.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
EUVD EUVD EUVD-2024-3585 Jinja is an extensible templating engine. In versions on the 3.x branch prior to 3.1.5, 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. To exploit the vulnerability, an attacker needs to control both the filename and the contents 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 where the template author can also choose the template filename. This vulnerability is fixed in 3.1.5.
Github GHSA Github GHSA GHSA-gmj6-6f8f-6699 Jinja has a sandbox breakout through malicious filenames
Ubuntu USN Ubuntu USN USN-7244-1 Jinja2 vulnerabilities
Ubuntu USN Ubuntu USN USN-7343-1 Jinja2 vulnerabilities
History
Type Values Removed Values Added
First Time appeared Palletsprojects
Palletsprojects jinja
CPEs cpe:2.3:a:palletsprojects:jinja:*:*:*:*:*:*:*:*
Vendors & Products Palletsprojects
Palletsprojects jinja
Metrics cvssV3_1

{'score': 7.3, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H'}

cvssV3_1

{'score': 8.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H'}

Type Values Removed Values Added
Metrics epss

{'score': 0.00064}

epss

{'score': 0.00052}

Type Values Removed Values Added
First Time appeared Redhat satellite
Redhat satellite Capsule
CPEs cpe:/a:redhat:satellite:6.15::el8
cpe:/a:redhat:satellite_capsule:6.15::el8
Vendors & Products Redhat satellite
Redhat satellite Capsule
Type Values Removed Values Added
First Time appeared Redhat openshift Ai
CPEs cpe:/a:redhat:openshift_ai:2.16::el8
cpe:/a:redhat:rhdh:1.5::el9
Vendors & Products Redhat openshift Ai
Type Values Removed Values Added
First Time appeared Redhat openstack
CPEs cpe:/a:redhat:openstack:17.1::el9
Vendors & Products Redhat openstack
Type Values Removed Values Added
Metrics cvssV3_1

{'score': 8.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H'}

cvssV3_1

{'score': 7.3, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H'}

Type Values Removed Values Added
CPEs cpe:/a:redhat:openshift_ironic:4.13::el9
cpe:/a:redhat:rhdh:1.4::el9
Type Values Removed Values Added
First Time appeared Redhat
Redhat ansible Automation Platform
Redhat discovery
Redhat enterprise Linux
Redhat openshift
Redhat openshift Ironic
Redhat rhdh
Redhat rhel E4s
Redhat rhel Eus
CPEs cpe:/a:redhat:ansible_automation_platform:2.4::el8
cpe:/a:redhat:ansible_automation_platform:2.4::el9
cpe:/a:redhat:ansible_automation_platform:2.5::el8
cpe:/a:redhat:ansible_automation_platform:2.5::el9
cpe:/a:redhat:ansible_automation_platform:ee::el8
cpe:/a:redhat:enterprise_linux:9
cpe:/a:redhat:openshift:4.16::el9
cpe:/a:redhat:openshift:4.17::el9
cpe:/a:redhat:openshift_ironic:4.12::el9
cpe:/a:redhat:openshift_ironic:4.14::el9
cpe:/a:redhat:openshift_ironic:4.15::el9
cpe:/a:redhat:openshift_ironic:4.16::el9
cpe:/a:redhat:openshift_ironic:4.17::el9
cpe:/a:redhat:rhdh:1.3::el9
cpe:/a:redhat:rhel_e4s:9.0
cpe:/a:redhat:rhel_eus:9.2
cpe:/a:redhat:rhel_eus:9.4
cpe:/o:redhat:discovery:1.0::el9
Vendors & Products Redhat
Redhat ansible Automation Platform
Redhat discovery
Redhat enterprise Linux
Redhat openshift
Redhat openshift Ironic
Redhat rhdh
Redhat rhel E4s
Redhat rhel Eus
Type Values Removed Values Added
Description Jinja is an extensible templating engine. Prior to 3.1.5, 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. To exploit the vulnerability, an attacker needs to control both the filename and the contents 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 where the template author can also choose the template filename. This vulnerability is fixed in 3.1.5. Jinja is an extensible templating engine. In versions on the 3.x branch prior to 3.1.5, 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. To exploit the vulnerability, an attacker needs to control both the filename and the contents 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 where the template author can also choose the template filename. This vulnerability is fixed in 3.1.5.
Type Values Removed Values Added
Metrics cvssV3_1

{'score': 8.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H'}

ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description Jinja is an extensible templating engine. Prior to 3.1.5, 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. To exploit the vulnerability, an attacker needs to control both the filename and the contents 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 where the template author can also choose the template filename. This vulnerability is fixed in 3.1.5.
Title Jinja has a sandbox breakout through malicious filenames
Weaknesses CWE-150
References
Metrics cvssV4_0

{'score': 5.4, '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'}