T09 · Insecure Skill Coding Practices
- Location
SKILL.md:29- Finding
Untrusted Model-Generated Lean Code Is Compiled Without the Claimed Isolation and Proof-Hole Checks
- Content
View full analysis
" cp "$1" "$PROJECT_DIR/Proof.lean" cd "$PROJECT_DIR" lake build ``` ### Technical Analysis The Skill directs users to send theorem statements and code to an external model and then compile the returned Lean source. Although the documentation correctly identifies generated `.lean` files as untrusted, the supplied `verify.sh` does not implement its stated security controls: 1. It contains no check that rejects `sorry`, `admit`, or equivalent proof-bypassing constructs. 2. `cd "$PROJECT_DIR"` only changes the working directory; it does not create a security sandbox or isolate the process. 3. `lake build` runs with the invoking user's permissions, environment, filesystem access, and network access. 4. Lean supports compile-time metaprogramming and elaboration features. Consequently, compiling untrusted Lean source is not equivalent to parsing inert proof text. 5. The script copies the input over `Proof.lean`, potentially replacing an existing project file. 6. Plain `lake build` does not necessarily prove that the newly copied `Proof.lean` is a configured build target. The command may therefore succeed without validating the intended file. The flagged pipeline at line 454 is not itself a remote shell execution pipeline: ```bash cur ...[truncated 2022 chars]- Remediation
View remediation
