CVE-2021-21386: APKLeaks Improper Neutralization Of Argument Delimiters Vulnerability
CRITICALCVE-2021-21386 is a CRITICAL (CVSS 9.3) improper neutralization of argument delimiters vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting APKLeaks libraries in the PyPI ecosystem. The issue involves improper neutralization of argument delimiters in a decompiling package process in apkleaks. Remediation is available by upgrading affected packages to version 2.0.4.
CVE-2021-21386 at a Glance
Security Impact
CVSS: 9.3
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:C/C:H/I:H/A:N).
How to Fix CVE-2021-21386
To remediate this vulnerability, upgrade all affected APKLeaks 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 APKLeaks>=2.0.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show APKLeaks
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2021-21386, inspect your installed packages using pip:
pip show APKLeaks
Analyze the terminal output to locate any version of APKLeaks in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.4), your application is affected.
Note: The pip show APKLeaks command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In APKLeaks, 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-21386 Affected APKLeaks Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
APKLeaks
|
PyPI |
< 2.0.4
|
2.0.4
|
References
Frequently Asked Questions
What is CVE-2021-21386?
Which APKLeaks versions are affected?
What version fixes CVE-2021-21386?
Is APKLeaks affected?
What is the CVSS score of CVE-2021-21386?
What CWE is associated with CVE-2021-21386?
How can I check PyPI dependencies for CVE-2021-21386?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-8434-v7xw-8m9x",
"modified" : "2022-05-27T22:48:38Z",
"published" : "2022-01-21T23:03:39Z",
"aliases" : [ "CVE-2021-21386" ],
"summary" : "Improper Neutralization of Argument Delimiters in a Decompiling Package Process in APKLeaks",
"details" : "APKLeaks prior to v2.0.4 allows remote authenticated attackers to execute arbitrary OS commands via package name inside the application manifest.\n\n### Impact\n\nAn authenticated attacker could include arguments that allow unintended commands or code to be executed, allow sensitive data to be read or modified, or could cause other unintended behavior through malicious package names.\n\n\n### References\n\n- a966e781499ff6fd4eea66876d7532301b13a382\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Email me at [me@dw1.io](mailto:me@dw1.io)\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "APKLeaks"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.0.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/dwisiswant0/apkleaks/security/advisories/GHSA-8434-v7xw-8m9x"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-21386"
}, {
"type" : "WEB",
"url" : "https://github.com/dwisiswant0/apkleaks/commit/a966e781499ff6fd4eea66876d7532301b13a382"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/dwisiswant0/apkleaks"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-78", "CWE-88" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2022-01-21T21:03:01Z",
"nvd_published_at" : "2021-03-24T21:15:00Z"
}
}