You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
Closes frontier item **A-12** from \`docs/PROOF-OPEN-FRONTIER.adoc\`:
prove that \`ShellState::resolve_path\` always returns a \`PathBuf\`
within the sandbox root, regardless of \`..\` / \`.\` / normal
components in the input.
Regression-guard for the **2026-02-12 CVE-class audit fix**
(\`resolve_path(\"../../etc/passwd\")\` previously escaped the sandbox).
## Changes
**Lean 4** — \`proofs/lean4/PathTraversal.lean\`
* Models the Rust resolve_path loop as \`Component → applyComponent\`.
* Proves \`applyComponent_preserves_root_prefix\` per component (with
sub-lemmas \`isPrefix_append_right\` and \`isPrefix_dropLast\`).
* Lifts to \`normalizeRaw_within_root\` via the foldl invariant.
* Headline: \`path_traversal_containment\` — \`root <+: normalizePath
root raw\` for all \`root\`, \`raw\`.
* Corollary: \`normalizePath_eq_normalizeRaw\` (the final clamp never
fires — the foldl invariant alone suffices).
* Wired into \`lakefile.lean\` as \`lean_lib PathTraversal\`.
* Verified locally: \`lean PathTraversal.lean\` exit 0.
**Rust** — \`impl/rust-cli/tests/security_tests.rs\`
* \`property_resolve_path_stays_within_sandbox\` — proptest with mixed
\`..\` / \`.\` / normal components, optional leading slash (256 random
cases per the proptest default).
* \`property_resolve_path_parent_dir_heavy_stays_within_sandbox\` — 10:1
weighted toward \`..\` to specifically target the audit failure mode.
* Both new tests + all 15 existing security tests pass (17 total).
## Test plan
- [x] \`lean PathTraversal.lean\` — exit 0
- [x] \`cargo test --test security_tests\` — 17 passed, 0 failed
- [ ] CI \`lean-verification.yml\` green
- [ ] CI \`rust-cli.yml\` security_tests job green
## References
* Independent of PR #128 (the Coq admit triumvirate) — these can land in
either order.
* Frontier doc: \`docs/PROOF-OPEN-FRONTIER.adoc\` §A-12
* Origin bug: 2026-02-12 Opus audit session (path_traversal in \`What
Was Fixed\` § \`CLAUDE.md\`)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments