CVE-2022-2111: Inventree Unrestricted Attachment Upload Vulnerability
HIGHCVE-2022-2111 is a HIGH (CVSS 8.8) unrestricted attachment upload vulnerability (CWE-434: Unrestricted Upload of File with Dangerous Type) affecting Inventree libraries in the PyPI ecosystem. The issue involves unrestricted attachment upload. Remediation is available by upgrading affected packages to version 0.7.2.
CVE-2022-2111 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:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2022-2111
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-2111, 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-434: Unrestricted Upload of File with Dangerous Type, where the product allows the upload or transfer of dangerous file types that are automatically processed within its environment. 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-2111 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-2111?
Which Inventree versions are affected?
What version fixes CVE-2022-2111?
Is inventree affected?
What is the CVSS score of CVE-2022-2111?
What CWE is associated with CVE-2022-2111?
How can I check PyPI dependencies for CVE-2022-2111?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-fr2w-mp56-g4xp",
"modified" : "2022-06-29T21:47:25Z",
"published" : "2022-06-17T01:16:55Z",
"aliases" : [ "CVE-2022-2111" ],
"summary" : "Unrestricted Attachment Upload",
"details" : "### Impact\n\nInvenTree allows unrestricted upload of files as attachments to various database fields. Potentially dangerous files (such as HTML files containing malicious javascript) can be uploaded, and (when opened by the user) run the malicious code directly in the users browser.\n\n\n\n*Note that the upload of malicious files must be performed by an authenticated user account*\n\n### Solution\n\nThe solution for this vulnerability is to ensure that attachment files are downloaded to the local machine before opening, rather than opening the file in the current browser context.\n\n### Patches\n\n- The issue is addressed in the upcoming 0.8.0 release\n- This fix will also be back-ported to the 0.7.x branch, applied to the 0.7.2 release\n\n### Workarounds\n\nUsers can alleviate risk of opening malicious files by right-clicking on the attachment link and selecting \"Save link as\"\n\n\n\nThis minimizes risk (e.g. of XSS attacks) by opening the HTML file from the users computer\n\n### References\n\nhttps://huntr.dev/bounties/a0e5c68e-0f75-499b-bd7b-d935fb8c0cd1/\n\n### For more information\nIf you have any questions or comments about this advisory:\n\n* Open an issue in [github](http://github.com/inventree/inventree)\n* Email us at [security@inventree.org](mailto:security@inventree.org)\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/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" : "WEB",
"url" : "https://github.com/inventree/InvenTree/security/advisories/GHSA-fr2w-mp56-g4xp"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-2111"
}, {
"type" : "WEB",
"url" : "https://github.com/inventree/inventree/commit/26bf51c20a1c9b3130ac5dd2e17649bece5ff84f"
}, {
"type" : "WEB",
"url" : "https://github.com/inventree/inventree-python"
}, {
"type" : "WEB",
"url" : "https://huntr.dev/bounties/a0e5c68e-0f75-499b-bd7b-d935fb8c0cd1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-434" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-06-17T01:16:55Z",
"nvd_published_at" : "2022-06-17T13:15:00Z"
}
}