CVE-2014-0012: Jinja2 Insecure Temporary File Vulnerability
MODERATECVE-2014-0012 is a MODERATE (CVSS 6.2) insecure temporary file vulnerability (CWE-377: Insecure Temporary File) affecting Jinja2 libraries in the PyPI ecosystem. The issue involves insecure temporary file in jinja2. Remediation is available by upgrading affected packages to version 2.7.2.
CVE-2014-0012 at a Glance
Security Impact
CVSS: 6.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).
How to Fix CVE-2014-0012
To remediate this vulnerability, upgrade all affected Jinja2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install Jinja2>=2.7.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show Jinja2
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2014-0012, inspect your installed packages using pip:
pip show Jinja2
Analyze the terminal output to locate any version of Jinja2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.7.2), your application is affected.
Note: The pip show Jinja2 command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-377: Insecure Temporary File, where creating and using insecure temporary files can leave application and system data vulnerable to attack. In Jinja2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2014-0012 Affected Jinja2 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
Jinja2
|
PyPI |
< 2.7.2
|
2.7.2
|
References
Frequently Asked Questions
What is CVE-2014-0012?
Which Jinja2 versions are affected?
What version fixes CVE-2014-0012?
Is Jinja2 affected?
What is the CVSS score of CVE-2014-0012?
What CWE is associated with CVE-2014-0012?
How can I check PyPI dependencies for CVE-2014-0012?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-fqh9-2qgg-h84h",
"modified" : "2024-09-23T19:26:46Z",
"published" : "2022-05-17T04:01:00Z",
"aliases" : [ "CVE-2014-0012" ],
"summary" : "Insecure Temporary File in Jinja2",
"details" : "FileSystemBytecodeCache in Jinja2 prior to version 2.7.2 does not properly create temporary directories, which allows local users to gain privileges by pre-creating a temporary directory with a user's uid. NOTE: this vulnerability exists because of an incomplete fix for CVE-2014-1402.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "Jinja2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.7.2"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2014-0012"
}, {
"type" : "WEB",
"url" : "https://github.com/mitsuhiko/jinja2/pull/292"
}, {
"type" : "WEB",
"url" : "https://github.com/mitsuhiko/jinja2/pull/296"
}, {
"type" : "WEB",
"url" : "https://github.com/pallets/jinja2/pull/292"
}, {
"type" : "WEB",
"url" : "https://github.com/pallets/jinja2/pull/296"
}, {
"type" : "WEB",
"url" : "https://github.com/mitsuhiko/jinja2/commit/acb672b6a179567632e032f547582f30fa2f4aa7"
}, {
"type" : "WEB",
"url" : "https://github.com/pallets/jinja/commit/acb672b6a179567632e032f547582f30fa2f4aa7"
}, {
"type" : "WEB",
"url" : "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=734747"
}, {
"type" : "WEB",
"url" : "https://bugzilla.redhat.com/show_bug.cgi?id=1051421"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/pallets/jinja2"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/jinja2/PYSEC-2014-82.yaml"
}, {
"type" : "WEB",
"url" : "http://seclists.org/oss-sec/2014/q1/73"
}, {
"type" : "WEB",
"url" : "http://www.gentoo.org/security/en/glsa/glsa-201408-13.xml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-377" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-02-14T00:58:39Z",
"nvd_published_at" : "2014-05-19T14:55:00Z"
}
}