CVE-2021-24040: Parlai Deserialization Of Untrusted Data Vulnerability
MODERATECVE-2021-24040 is a MODERATE deserialization of untrusted data vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Parlai libraries in the PyPI ecosystem. The issue involves deserialization of untrusted data in parlai. Remediation is available by upgrading affected packages to version 1.1.0.
CVE-2021-24040 at a Glance
How to Fix CVE-2021-24040
To remediate this vulnerability, upgrade all affected Parlai 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 parlai>=1.1.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show parlai
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2021-24040, inspect your installed packages using pip:
pip show parlai
Analyze the terminal output to locate any version of Parlai in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.0), your application is affected.
Note: The pip show parlai command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. In Parlai, 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-2021-24040 Affected Parlai Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
parlai
|
PyPI |
< 1.1.0
|
1.1.0
|
References
Frequently Asked Questions
What is CVE-2021-24040?
Which Parlai versions are affected?
What version fixes CVE-2021-24040?
Is parlai affected?
What CWE is associated with CVE-2021-24040?
How can I check PyPI dependencies for CVE-2021-24040?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-mwgj-7x7j-6966",
"modified" : "2021-09-13T19:29:03Z",
"published" : "2021-09-13T20:06:14Z",
"aliases" : [ "CVE-2021-24040" ],
"summary" : "Deserialization of Untrusted Data in ParlAI",
"details" : "Due to use of unsafe YAML deserialization logic, an attacker with the ability to modify local YAML configuration files could provide malicious input, resulting in remote code execution or similar risks. This issue affects ParlAI prior to v1.1.0.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "parlai"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.1.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/facebookresearch/ParlAI/security/advisories/GHSA-m87f-9fvv-2mgg"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-24040"
}, {
"type" : "WEB",
"url" : "https://github.com/facebookresearch/ParlAI/pull/3402"
}, {
"type" : "WEB",
"url" : "https://github.com/facebookresearch/ParlAI/pull/3429"
}, {
"type" : "WEB",
"url" : "https://github.com/facebookresearch/ParlAI/commit/4374fa2aba383db6526ab36e939eb1cf8ef99879"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/facebookresearch/ParlAI"
}, {
"type" : "WEB",
"url" : "https://github.com/facebookresearch/ParlAI/releases/tag/v1.1.0"
}, {
"type" : "WEB",
"url" : "http://packetstormsecurity.com/files/164136/Facebook-ParlAI-1.0.0-Code-Execution-Deserialization.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-502" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-09-13T19:29:03Z",
"nvd_published_at" : "2021-09-10T22:15:00Z"
}
}