Skip to content

fix(security): reject symlink and path-containment escapes - #132

Draft
cursor[bot] wants to merge 4 commits into
mainfrom
cursor/critical-bug-investigation-2ca2
Draft

fix(security): reject symlink and path-containment escapes#132
cursor[bot] wants to merge 4 commits into
mainfrom
cursor/critical-bug-investigation-2ca2

Conversation

@cursor

@cursor cursor Bot commented Aug 4, 2026

Copy link
Copy Markdown

Summary

  • Fixes critical workspace containment bypasses where agent builtin read_file/write_file (and desktop workspace editor) used lexical normalize_path only, so an in-workspace symlink to an outside target could be read/written.
  • Closes the Tauri-only gap left by open PR fix(evolution): constrain pending skill path operations #89: read_evolution_pending_skill_md now requires a single-segment pending skill name before joining under _pending.
  • Constrains stdio/CLI bash --cwd to skill dir / workspace / output dir / process cwd / skills root, and stops rewrite_output_paths from injecting ../ or Windows drive-absolute tokens.

Bug Impact

  • Arbitrary host file read/write via workspace symlink follow (agent + desktop).
  • Arbitrary SKILL.md read outside _pending via Tauri pending preview (skill_name=/tmp/...).
  • Allowlisted relative bash commands retargetable via unconstrained --cwd.
  • Output-path rewrite could force escaped absolute destinations.

Task Linkage

  • Task ID: TASK-2026-080
  • Task folder: tasks/TASK-2026-080-workspace-symlink-path-safety/

Injected Specs

  • spec/verification-integrity.md
  • spec/task-artifact-language.md
  • spec/security-nonnegotiables.md
  • spec/rust-conventions.md
  • spec/testing-policy.md
  • spec/docs-sync.md (N/A: fail-closed validation only)

Validation Evidence

  • Commands executed:
    • cargo test -p skilllite-agent path_containment → 4 passed
    • cargo test -p skilllite-agent rewrite_output_paths → 3 passed
    • cargo test -p skilllite-commands bash_cwd → 2 passed
    • cargo test -p skilllite-assistant pending_name --manifest-path crates/skilllite-assistant/src-tauri/Cargo.toml → 2 passed
    • cargo clippy -p skilllite-agent -p skilllite-commands --all-targets -- -D warnings -A dead_code -A clippy::question_mark -A clippy::useless_borrows_in_formatting → clean
    • cargo fmt -p skilllite-agent -p skilllite-commands -- --check → clean
    • python3 scripts/validate_tasks.py → passed (71 task folders)
  • Concrete PoCs before fix: symlink workspace/leak.txt -> /tmp/secret passed lexical check and opened outside content; Tauri-style Path::join with skill_name=/tmp/outside_pending read /tmp/outside_pending/SKILL.md.

Regression Scope

Docs Sync (EN/ZH)

  • Not needed
  • Updated EN + ZH docs
    Files:
    • N/A

Security Review Notes

  • What security policy changed, and why is it needed? Workspace/output path resolution must reject symlink targets outside the root; pending skill names and bash cwd must stay contained.
  • Is default behavior more permissive? No — fail-closed.
  • Does this affect SKILLLITE_* config semantics? No.
  • Were tests and EN/ZH docs updated? Tests yes; docs N/A.

Review Checklist

  • Acceptance criteria in tasks/TASK-2026-080-workspace-symlink-path-safety/TASK.md satisfied
  • tasks/TASK-2026-080-workspace-symlink-path-safety/STATUS.md updated with latest progress
  • tasks/TASK-2026-080-workspace-symlink-path-safety/REVIEW.md includes merge readiness decision
  • tasks/board.md status is up to date
Open in Web View Automation 

cursoragent and others added 4 commits August 4, 2026 11:10
Harden agent/desktop workspace resolution against in-tree symlink
follow-outs, constrain bash --cwd to allowed roots, stop rewrite_output_paths
from injecting traversal/drive targets, and validate Tauri pending skill names.

Co-authored-by: EXboy <EXboys@users.noreply.github.com>
Co-authored-by: EXboy <EXboys@users.noreply.github.com>
Co-authored-by: EXboy <EXboys@users.noreply.github.com>
Co-authored-by: EXboy <EXboys@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant