CVE-2021-23420: Codeception/codeception Deserialization Of Untrusted Data Vulnerability
CRITICALCVE-2021-23420 is a CRITICAL (CVSS 9.8) deserialization of untrusted data vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Codeception/codeception libraries in the Packagist ecosystem. The issue involves deserialization of untrusted data in codeception/codeception. Remediation is available by upgrading affected packages to version 3.1.3, 4.1.22.
CVE-2021-23420 at a Glance
Security Impact
CVSS: 9.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:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2021-23420
To remediate this vulnerability, upgrade all affected Codeception/codeception dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade codeception/codeception to 3.1.3
Upgrade codeception/codeception to 4.1.22
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for codeception/codeception
How to Check if You Are Affected
To determine whether your application is affected by CVE-2021-23420, inspect your project dependencies for Codeception/codeception:
inspect dependencies for codeception/codeception
Analyze the terminal output to locate any version of Codeception/codeception in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.1.3), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
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 Codeception/codeception, 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-23420 Affected Codeception/codeception Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
codeception/codeception
|
Packagist |
< 3.1.3
|
3.1.3
|
|
codeception/codeception
|
Packagist |
≥ 4.0.0
< 4.1.22
|
4.1.22
|
References
Frequently Asked Questions
What is CVE-2021-23420?
Which Codeception/codeception versions are affected?
What version fixes CVE-2021-23420?
Is codeception/codeception affected?
What is the CVSS score of CVE-2021-23420?
What CWE is associated with CVE-2021-23420?
How can I check Packagist dependencies for CVE-2021-23420?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4574-qv3w-fcmg",
"modified" : "2021-08-30T19:17:39Z",
"published" : "2021-09-01T18:36:15Z",
"aliases" : [ "CVE-2021-23420" ],
"summary" : " Deserialization of Untrusted Data in codeception/codeception",
"details" : "This affects the package codeception/codeception from 4.0.0 before 4.1.22 and before 3.1.3. The RunProcess class can be leveraged as a gadget to run arbitrary commands on a system that is deserializing user input without validation.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "codeception/codeception"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.1.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "codeception/codeception"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.0.0"
}, {
"fixed" : "4.1.22"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-23420"
}, {
"type" : "WEB",
"url" : "https://github.com/Codeception/Codeception/pull/6241"
}, {
"type" : "WEB",
"url" : "https://github.com/Codeception/Codeception/commit/802a108057d250ee563120eaa5365a519afc0a71"
}, {
"type" : "WEB",
"url" : "https://github.com/Codeception/Codeception/commit/cbce9ea7f4664052fa1ac6b36f5b5a6dbd864d71"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Codeception/Codeception"
}, {
"type" : "WEB",
"url" : "https://github.com/Codeception/Codeception/blob/4.1/CHANGELOG-4.x.md#4122"
}, {
"type" : "WEB",
"url" : "https://github.com/Codeception/Codeception/blob/4.1/ext/RunProcess.php#L52"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/codeception/codeception/CVE-2021-23420.yaml"
}, {
"type" : "WEB",
"url" : "https://github.com/JinYiTong/poc"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-4574-qv3w-fcmg"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-PHP-CODECEPTIONCODECEPTION-1324585"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-502" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2021-08-30T19:17:39Z",
"nvd_published_at" : "2021-08-11T13:15:00Z"
}
}