T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/jdxb.sh:7
- Finding
- Unverified remote payload is installed as a persistent root service<![CDATA[ ## Vulnerability Details **File Location**: `scripts/jdxb.sh`, lines 7 and 141-197 **Vulnerability Type**: Unauthenticated remote code retrieval, privileged execution, and system persistence **Risk Level**: Critical ### Code Snippet ```bash BASE_URL="http://cdn.ionewu.com/upgrade/d" ``` ```bash local url="${BASE_URL}/${filename}" local workdir workdir=$(dirname "$INSTALL_DIR") cd "$workdir" if [[ ! -f "${filename}" ]]; then curl -fSL --progress-bar -O "${url}" || err "Download failed" fi tar -xzf "${filename}" || err "Extraction failed" local exec_script="${workdir}/${APP_NAME}/start.sh" [[ -f "$exec_script" ]] || err "start.sh was not found" chmod +x "$exec_script" cat > "$SERVICE_FILE" << EOF [Unit] Description=Owjdxb Service After=network.target Wants=network.target [Service] Type=oneshot User=root Group=root WorkingDirectory=${workdir}/${APP_NAME} ExecStart=${exec_script} RemainAfterExit=yes StandardOutput=journal StandardError=journal [Install] WantedBy=multi-user.target EOF systemctl daemon-reload systemctl enable "${APP_NAME}.service" systemctl restart "${APP_NAME}.service" ``` ### Technical Analysis The installer downloads an archive from a plaintext HTTP endpoint. It does not verify a cryptographic checksum, digital signature, trusted publisher identity, or pinned artifact digest before extracting and executing the downloaded content. The archive's `start.sh` is registered as the executable of a systemd service configured with `User=root` and `Group=root`. The service is enabled for `multi-user.target`, so the externally supplied payload runs immediately and persists across reboots. A systemd service is functionally consistent with managing an always-on remote-access product. However, automatically granting a mutable and unauthenticated remote payload persistent root execution exceeds minimum privilege. A dedicated unprivileged service account and a verified, immutable release artifact would be substantially safer. ### Atta ...[truncated 1067 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace the HTTP source with an HTTPS endpoint controlled by the verified publisher. 2. Publish a SHA-256 or stronger digest through a separately authenticated channel and verify it before extraction. 3. Prefer signed release manifests or package signatures and validate the signing key against a pinned trusted key. 4. Download into a securely created temporary directory rather than a predictable or reusable path. 5. Abort installation if any signature or digest validation fails. 6. Run the service under a dedicated, non-login, unprivileged account instead of root. 7. Add systemd hardening such as `NoNewPrivileges=yes`, `PrivateTmp=yes`, `ProtectSystem=strict`, `ProtectHome=yes`, restricted writable paths, and capability restrictions. 8. Require explicit user confirmation before enabling boot persistence; installation and service enablement should be separate operations. 9. Prefer a packaged, auditable executable over an externally mutable startup script. ]]>
