T09 · Insecure Skill Coding Practices
- Location
scripts/testing_worker.sh:4- Finding
Untrusted archive extraction followed by execution of archive-controlled code
- Content
View full analysis
&1 || true) ``` ### Technical Analysis The testing worker accepts an archive path from the caller, extracts the archive without validating its origin or contents, and then directly executes `code/scripts/hello.sh` from the extracted files. There is no integrity or provenance verification to establish that the archive was produced by the trusted coding worker. Archive members are not checked for absolute paths, parent-directory traversal components, symbolic links, hard links, device files, or unexpected executable content. The direct execution step makes arbitrary command execution straightforward: an attacker only needs to package a malicious file at `code/scripts/hello.sh`. Archive traversal or link-based entries could additionally affect files outside the intended working directory, depending on the behavior and protections of the installed `tar` implementation. The `|| true` construct suppresses the malicious script's failure status. It does not prevent execution and can make failures less visible to the surrounding workflow. ### Attack Path 1. An attacker creates a gzip-compressed tar archive containing an executable `code/scripts/hello.sh`. 2. The malicious script contains commands chosen by the attacker. 3. The attacker invokes `testing_worker.sh` or influences its caller so that the crafted archive is supplied as `ARTIFACT_PATH`. 4. The worker extracts the archive into its working directory. 5. The worker runs `./code/scripts/hello.sh`. 6. The payload exec ...[truncated 921 chars]- Remediation
View remediation
