Vulnerabilities in pkg:pypi/APKLeaks

PACKAGE
Advisory Identifier: GHSA-8434-v7xw-8m9x
Advisory Summary

CVE-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.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/APKLeaks

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/APKLeaks. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-8434-v7xw-8m9x CVE-2021-21386 CRITICAL Improper Neutralization of Argument Delimiters in a Decompiling Package Process in APKLeaks

CVE-2021-21386 at a Glance

CVE Identifier CVE-2021-21386
GHSA Identifier GHSA-8434-v7xw-8m9x
Severity CRITICAL
CVSS v3.1 Base Score 9.3
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product APKLeaks
Package Ecosystem PyPI
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (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.

APKLeaks fixed: 2.0.4
pip install APKLeaks>=2.0.4
Verify Direct and Transitive Dependencies

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

APKLeaks prior to v2.0.4 allows remote authenticated attackers to execute arbitrary OS commands via package name inside the application manifest. ### Impact An 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. ### References - a966e781499ff6fd4eea66876d7532301b13a382 ### For more information If you have any questions or comments about this advisory: * Email me at [me@dw1.io](mailto:me@dw1.io)

CVE-2021-21386 Affected APKLeaks Versions

1 component(s)
Fixed Versions:
2.0.4
Product / Package Ecosystem Affected Versions Fixed Version
APKLeaks
PyPI
< 2.0.4
2.0.4

References

Frequently Asked Questions

What is CVE-2021-21386?
CVE-2021-21386 is a security vulnerability in APKLeaks involving Improper Neutralization of Argument Delimiters in a Decompiling Package Process in APKLeaks under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which APKLeaks versions are affected?
Affected versions include releases prior to 2.0.4 across affected packages: APKLeaks.
What version fixes CVE-2021-21386?
Upgrading to 2.0.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is APKLeaks affected?
Yes, APKLeaks is affected in releases prior to 2.0.4. Upgrade your dependency to 2.0.4 or later.
What is the CVSS score of CVE-2021-21386?
CVE-2021-21386 has a CVSS v3.1 base score of 9.3 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N.
What CWE is associated with CVE-2021-21386?
CVE-2021-21386 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (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.).
How can I check PyPI dependencies for CVE-2021-21386?
Run the dependency tree command: 'pip show APKLeaks'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}