{"id":"USN-7343-1","summary":"jinja2 vulnerabilities","details":"\nRafal Krupinski discovered that Jinja2 did not properly restrict\nthe execution of code in situations where templates are used maliciously.\nAn attacker with control over a template's filename and content could\npotentially use this issue to enable the execution of arbitrary code.\nThis issue only affected Ubuntu 14.04 LTS and Ubuntu 16.04 LTS.\n(CVE-2024-56201)\n\nIt was discovered that Jinja2 sandboxed environments could be escaped\nthrough a call to a string format method. An attacker could possibly use\nthis issue to enable the execution of arbitrary code. This issue only\naffected Ubuntu 14.04 LTS and Ubuntu 16.04 LTS. (CVE-2024-56326)\n\nIt was discovered that Jinja2 sandboxed environments could be escaped\nthrough the malicious use of certain filters. An attacker could possibly\nuse this issue to enable the execution of arbitrary code. (CVE-2025-27516)\n\n","modified":"2026-02-10T04:47:18Z","published":"2025-03-11T17:25:01Z","related":["UBUNTU-CVE-2024-56201","UBUNTU-CVE-2024-56326","UBUNTU-CVE-2025-27516"],"upstream":["CVE-2024-56201","CVE-2024-56326","CVE-2025-27516","UBUNTU-CVE-2024-56201","UBUNTU-CVE-2024-56326","UBUNTU-CVE-2025-27516"],"references":[{"type":"ADVISORY","url":"https://ubuntu.com/security/notices/USN-7343-1"},{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2024-56201"},{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2024-56326"},{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2025-27516"}],"affected":[{"package":{"name":"jinja2","ecosystem":"Ubuntu:Pro:14.04:LTS","purl":"pkg:deb/ubuntu/jinja2@2.7.2-2ubuntu0.1~esm6?arch=source&distro=esm-infra-legacy/trusty"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.7.2-2ubuntu0.1~esm6"}]}],"versions":["2.7-3","2.7.1-1","2.7.2-1","2.7.2-2","2.7.2-2ubuntu0.1~esm1","2.7.2-2ubuntu0.1~esm2","2.7.2-2ubuntu0.1~esm3","2.7.2-2ubuntu0.1~esm4"],"ecosystem_specific":{"availability":"Available with Ubuntu Pro with Legacy support add-on: https://ubuntu.com/pro","binaries":[{"binary_name":"python-jinja2","binary_version":"2.7.2-2ubuntu0.1~esm6"},{"binary_name":"python3-jinja2","binary_version":"2.7.2-2ubuntu0.1~esm6"}]},"database_specific":{"cves_map":{"cves":[{"id":"CVE-2024-56201","severity":[{"type":"CVSS_V4","score":"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"},{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H"},{"type":"Ubuntu","score":"medium"}]},{"id":"CVE-2024-56326","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"},{"type":"CVSS_V4","score":"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"},{"type":"Ubuntu","score":"medium"}]},{"id":"CVE-2025-27516","severity":[{"type":"CVSS_V4","score":"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"},{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H"},{"type":"Ubuntu","score":"medium"}]}],"ecosystem":"Ubuntu:Pro:14.04:LTS"},"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/usn/USN-7343-1.json"}},{"package":{"name":"jinja2","ecosystem":"Ubuntu:Pro:16.04:LTS","purl":"pkg:deb/ubuntu/jinja2@2.8-1ubuntu0.1+esm5?arch=source&distro=esm-infra/xenial"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.8-1ubuntu0.1+esm5"}]}],"versions":["2.8-1","2.8-1ubuntu0.1","2.8-1ubuntu0.1+esm1","2.8-1ubuntu0.1+esm2","2.8-1ubuntu0.1+esm3"],"ecosystem_specific":{"availability":"Available with Ubuntu Pro (Infra-only): https://ubuntu.com/pro","binaries":[{"binary_name":"python-jinja2","binary_version":"2.8-1ubuntu0.1+esm5"},{"binary_name":"python3-jinja2","binary_version":"2.8-1ubuntu0.1+esm5"}]},"database_specific":{"cves_map":{"cves":[{"id":"CVE-2024-56201","severity":[{"type":"CVSS_V4","score":"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"},{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H"},{"type":"Ubuntu","score":"medium"}]},{"id":"CVE-2024-56326","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"},{"type":"CVSS_V4","score":"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"},{"type":"Ubuntu","score":"medium"}]},{"id":"CVE-2025-27516","severity":[{"type":"CVSS_V4","score":"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"},{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H"},{"type":"Ubuntu","score":"medium"}]}],"ecosystem":"Ubuntu:Pro:16.04:LTS"},"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/usn/USN-7343-1.json"}},{"package":{"name":"jinja2","ecosystem":"Ubuntu:Pro:18.04:LTS","purl":"pkg:deb/ubuntu/jinja2@2.10-1ubuntu0.18.04.1+esm4?arch=source&distro=esm-infra/bionic"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.10-1ubuntu0.18.04.1+esm4"}]}],"versions":["2.9.6-1","2.10-1","2.10-1ubuntu0.18.04.1","2.10-1ubuntu0.18.04.1+esm1","2.10-1ubuntu0.18.04.1+esm2","2.10-1ubuntu0.18.04.1+esm3"],"ecosystem_specific":{"availability":"Available with Ubuntu Pro (Infra-only): https://ubuntu.com/pro","binaries":[{"binary_name":"python-jinja2","binary_version":"2.10-1ubuntu0.18.04.1+esm4"},{"binary_name":"python3-jinja2","binary_version":"2.10-1ubuntu0.18.04.1+esm4"}]},"database_specific":{"cves_map":{"cves":[{"id":"CVE-2025-27516","severity":[{"type":"CVSS_V4","score":"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"},{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H"},{"type":"Ubuntu","score":"medium"}]}],"ecosystem":"Ubuntu:Pro:18.04:LTS"},"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/usn/USN-7343-1.json"}},{"package":{"name":"jinja2","ecosystem":"Ubuntu:20.04:LTS","purl":"pkg:deb/ubuntu/jinja2@2.10.1-2ubuntu0.5?arch=source&distro=focal"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.10.1-2ubuntu0.5"}]}],"versions":["2.10-2ubuntu1","2.10-2ubuntu2","2.10.1-1ubuntu1","2.10.1-2","2.10.1-2ubuntu0.2","2.10.1-2ubuntu0.3","2.10.1-2ubuntu0.4"],"ecosystem_specific":{"availability":"No subscription required","binaries":[{"binary_name":"python-jinja2","binary_version":"2.10.1-2ubuntu0.5"},{"binary_name":"python3-jinja2","binary_version":"2.10.1-2ubuntu0.5"}]},"database_specific":{"cves_map":{"cves":[{"id":"CVE-2025-27516","severity":[{"type":"CVSS_V4","score":"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"},{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H"},{"type":"Ubuntu","score":"medium"}]}],"ecosystem":"Ubuntu:20.04:LTS"},"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/usn/USN-7343-1.json"}},{"package":{"name":"jinja2","ecosystem":"Ubuntu:22.04:LTS","purl":"pkg:deb/ubuntu/jinja2@3.0.3-1ubuntu0.4?arch=source&distro=jammy"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.0.3-1ubuntu0.4"}]}],"versions":["2.11.3-1","3.0.1-2","3.0.3-1","3.0.3-1ubuntu0.1","3.0.3-1ubuntu0.2","3.0.3-1ubuntu0.3"],"ecosystem_specific":{"availability":"No subscription required","binaries":[{"binary_name":"python3-jinja2","binary_version":"3.0.3-1ubuntu0.4"}]},"database_specific":{"cves_map":{"cves":[{"id":"CVE-2025-27516","severity":[{"type":"CVSS_V4","score":"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"},{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H"},{"type":"Ubuntu","score":"medium"}]}],"ecosystem":"Ubuntu:22.04:LTS"},"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/usn/USN-7343-1.json"}},{"package":{"name":"jinja2","ecosystem":"Ubuntu:24.04:LTS","purl":"pkg:deb/ubuntu/jinja2@3.1.2-1ubuntu1.3?arch=source&distro=noble"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.1.2-1ubuntu1.3"}]}],"versions":["3.1.2-1","3.1.2-1ubuntu1","3.1.2-1ubuntu1.1","3.1.2-1ubuntu1.2"],"ecosystem_specific":{"availability":"No subscription required","binaries":[{"binary_name":"python3-jinja2","binary_version":"3.1.2-1ubuntu1.3"}]},"database_specific":{"cves_map":{"cves":[{"id":"CVE-2025-27516","severity":[{"type":"CVSS_V4","score":"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"},{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H"},{"type":"Ubuntu","score":"medium"}]}],"ecosystem":"Ubuntu:24.04:LTS"},"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/usn/USN-7343-1.json"}}],"schema_version":"1.7.3"}