Miggo Logo

CVE-2021-21386: Improper Neutralization of Argument Delimiters in a Decompiling Package Process in APKLeaks

9.3

CVSS Score
3.1

Basic Information

EPSS Score
0.76573%
Published
1/21/2022
Updated
9/7/2023
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
APKLeakspip< 2.0.42.0.4

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from the pre-patch command construction pattern '%s %s -d %s --deobf' which directly interpolated user-controlled values (dex path and tempdir) into an OS command. This allowed injection of command arguments through malicious package names. The commit explicitly fixes this by: 1) Using an array for arguments 2) Applying proper shell escaping with pipes.quote() 3) Safely joining arguments. The vulnerable code path is clearly in the decompile() method where the unsafe os.system() call originated.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

*PKL**ks prior to v*.*.* *llows r*mot* *ut**nti**t** *tt**k*rs to *x**ut* *r*itr*ry OS *omm*n*s vi* p**k*** n*m* insi** t** *ppli**tion m*ni**st. ### Imp**t *n *ut**nti**t** *tt**k*r *oul* in*lu** *r*um*nts t**t *llow unint*n*** *omm*n*s or *o** to

Reasoning

T** vuln*r**ility st*ms *rom t** pr*-p*t** *omm*n* *onstru*tion p*tt*rn '%s %s -* %s --**o**' w*i** *ir**tly int*rpol*t** us*r-*ontroll** v*lu*s (**x p*t* *n* t*mp*ir) into *n OS *omm*n*. T*is *llow** inj**tion o* *omm*n* *r*um*nts t*rou** m*li*ious