CVE-2022-2112: Inventree CSV Injection Vulnerability
HIGHCVE-2022-2112 is a HIGH (CVSS 8.8) csv injection vulnerability (CWE-1236: Improper Neutralization of Formula Elements in a CSV File) affecting Inventree libraries in the PyPI ecosystem. The issue involves csv injection in inventree. Remediation is available by upgrading affected packages to version 0.7.2.
CVE-2022-2112 at a Glance
Security Impact
CVSS: 8.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).
How to Fix CVE-2022-2112
To remediate this vulnerability, upgrade all affected Inventree 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 inventree>=0.7.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show inventree
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2022-2112, inspect your installed packages using pip:
pip show inventree
Analyze the terminal output to locate any version of Inventree in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.7.2), your application is affected.
Note: The pip show inventree command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-1236: Improper Neutralization of Formula Elements in a CSV File, where the product saves user-provided information into a comma-separated value (csv) file, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as a command when the file is opened by a spreadsheet product. In Inventree, 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-2022-2112 Affected Inventree Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
inventree
|
PyPI |
< 0.7.2
|
0.7.2
|
References
Frequently Asked Questions
What is CVE-2022-2112?
Which Inventree versions are affected?
What version fixes CVE-2022-2112?
Is inventree affected?
What is the CVSS score of CVE-2022-2112?
What CWE is associated with CVE-2022-2112?
How can I check PyPI dependencies for CVE-2022-2112?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9hx5-jmxv-x44q",
"modified" : "2022-07-05T22:17:16Z",
"published" : "2022-06-18T00:00:25Z",
"aliases" : [ "CVE-2022-2112" ],
"summary" : "CSV Injection in inventree",
"details" : "Improper Neutralization of Formula Elements in a CSV File in GitHub repository inventree/inventree prior to 0.7.2.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "inventree"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.7.2"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-2112"
}, {
"type" : "WEB",
"url" : "https://github.com/inventree/inventree/commit/26bf51c20a1c9b3130ac5dd2e17649bece5ff84f"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/inventree/InvenTree"
}, {
"type" : "WEB",
"url" : "https://huntr.dev/bounties/e57c36e7-fa39-435f-944a-3a52ee066f73"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1236" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-07-05T22:17:16Z",
"nvd_published_at" : "2022-06-17T13:15:00Z"
}
}