T03 · Remote Payload Retrieval and Execution
Warning
- Location
- SKILL.md:31
- Finding
- Unverified JADX Archive Installed into System-Wide Executable Paths<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:31` **Vulnerability Type**: Unverified remote executable retrieval and privileged system-wide installation **Risk Level**: Medium ### Vulnerable Code ```json "script": "cd /tmp && curl -L -o jadx.zip https://github.com/skylot/jadx/releases/download/v1.5.0/jadx-1.5.0.zip && unzip -o jadx.zip && mkdir -p /opt/jadx && cp -r lib /opt/jadx/ && cp bin/jadx /opt/jadx/ && sed -i 's|APP_HOME=\".*\"|APP_HOME=\"/opt/jadx\"|g' /opt/jadx/jadx && ln -sf /opt/jadx/jadx /usr/local/bin/jadx", ``` ### Technical Analysis The installation command downloads a ZIP archive from an external GitHub release and immediately extracts and installs its contents without verifying a cryptographic checksum or release signature. Pinning the URL to JADX version `1.5.0` improves reproducibility but does not establish the integrity or authenticity of the downloaded bytes. The archive is extracted directly in the shared `/tmp` directory rather than a newly created, permission-restricted temporary directory. Existing `lib` and `bin/jadx` paths in the working directory could consequently influence what is copied if extraction fails to replace them as expected or if the command operates in an unsafe multi-user environment. The command writes to `/opt/jadx` and creates `/usr/local/bin/jadx`, which normally requires elevated privileges and exposes the downloaded launcher through the global executable search path. JADX is relevant when Java-like source decompilation is requested, but it is supplementary to Apktool's core APK resource and smali operations. Requiring and installing it globally exceeds the minimum privilege and dependency scope for Apktool-only workflows. ### Attack Path 1. An attacker compromises or replaces the referenced release asset, its hosting account, or another component of the download trust path. 2. The installation command follows redirects and accepts the resulting archive without checksum or signature vali ...[truncated 1262 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Publish and pin an expected SHA-256 digest for the exact JADX archive, then verify it before extraction: ```sh printf '%s %s\n' "$EXPECTED_SHA256" "$archive" | sha256sum -c - ``` 2. Where available, verify an upstream cryptographic release signature using a separately trusted signing key. 3. Create a private temporary directory with `mktemp -d`, apply restrictive permissions, and install only from that directory. 4. Use `set -euo pipefail`, validate the extracted file layout, and abort on any unexpected entry or failed validation. 5. Avoid extracting into a shared directory with predictable filenames. 6. Prefer a trusted operating-system package manager where an appropriate package is available. 7. Install JADX under a user-controlled directory such as `~/.local/opt/jadx`, with a link under `~/.local/bin`, unless the user explicitly approves a system-wide installation. 8. Declare JADX as optional and install it only when Java decompilation is specifically requested. 9. Require explicit user confirmation before modifying `/opt` or `/usr/local/bin`. ]]>
