CVE-2021-39207: Parlai Deserialization Of Untrusted Data Vulnerability
MODERATECVE-2021-39207 is a MODERATE (CVSS 8.4) 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-39207 at a Glance
Security Impact
CVSS: 8.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:L).
How to Fix CVE-2021-39207
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-39207, 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-39207 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-39207?
Which Parlai versions are affected?
What version fixes CVE-2021-39207?
Is parlai affected?
What is the CVSS score of CVE-2021-39207?
What CWE is associated with CVE-2021-39207?
How can I check PyPI dependencies for CVE-2021-39207?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-m87f-9fvv-2mgg",
"modified" : "2024-10-09T21:00:01Z",
"published" : "2021-09-13T20:05:39Z",
"aliases" : [ "CVE-2021-39207" ],
"summary" : "Deserialization of Untrusted Data in parlai",
"details" : "### Impact\nDue 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.\n\n### Patches\nThe issue can be patched by upgrading to v1.1.0 or later. It can also be patched by replacing YAML deserialization with equivalent safe_load calls.\n\n### References\n\n- https://github.com/facebookresearch/ParlAI/commit/507d066ef432ea27d3e201da08009872a2f37725\n- https://github.com/facebookresearch/ParlAI/commit/4374fa2aba383db6526ab36e939eb1cf8ef99879\n- https://anon-artist.github.io/blogs/blog3.html",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:L"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:L"
} ],
"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-39207"
}, {
"type" : "WEB",
"url" : "https://github.com/facebookresearch/ParlAI/commit/4374fa2aba383db6526ab36e939eb1cf8ef99879"
}, {
"type" : "WEB",
"url" : "https://github.com/facebookresearch/ParlAI/commit/507d066ef432ea27d3e201da08009872a2f37725"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-mwgj-7x7j-6966"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/facebookresearch/ParlAI"
}, {
"type" : "WEB",
"url" : "https://github.com/facebookresearch/ParlAI/releases/tag/v1.1.0"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/parlai/PYSEC-2021-330.yaml"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/parlai/PYSEC-2021-334.yaml"
}, {
"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:10:21Z",
"nvd_published_at" : "2021-09-10T23:15:00Z"
}
}