subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
os.makedirs(extracted_dir, exist_ok=True) # 使用 unzip 解压 result = subprocess.run( ['unzip', '-o', apk_path, '-d', extracted_dir], capture_output=True, text=True )- Confidence
- 93% confidence
- Finding
- This invokes the external unzip tool on a user-supplied APK and extracts its contents directly into a local directory without validating archive entry paths or enforcing a safe extraction policy. A malicious APK/ZIP can exploit path traversal or symlink behaviors during extraction, causing files to be written outside the intended output directory and potentially overwriting local files.
