Skip to content

Comments

detect relative path traversal in shell sandbox#325

Merged
bug-ops merged 1 commit intomainfrom
feat/m14/shell-sandbox-relative
Feb 15, 2026
Merged

detect relative path traversal in shell sandbox#325
bug-ops merged 1 commit intomainfrom
feat/m14/shell-sandbox-relative

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 15, 2026

Summary

  • Extend validate_sandbox to detect relative paths (./, ../, ..) in addition to absolute paths
  • Reject any path containing .. traversal segments before canonicalization to prevent sandbox escape
  • Canonicalize relative paths against CWD for proper sandbox boundary checks
  • Add tokio/macros to zeph-tools dependencies (fixes pre-existing build issue with tokio::select!)

Test plan

  • Unit tests for has_traversal detection
  • Unit tests for extract_paths with relative path extraction
  • Sandbox rejection tests for ../, .., ./ outside allowed paths
  • Sandbox rejection for absolute paths with embedded .. traversal
  • All 240 zeph-tools tests pass
  • Workspace clippy clean

Closes #308

@codecov-commenter
Copy link

codecov-commenter commented Feb 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #325      +/-   ##
==========================================
+ Coverage   80.32%   80.35%   +0.03%     
==========================================
  Files          99       99              
  Lines       24099    24152      +53     
==========================================
+ Hits        19357    19408      +51     
- Misses       4742     4744       +2     
Files with missing lines Coverage Δ
crates/zeph-tools/src/shell.rs 97.33% <100.00%> (+0.18%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Extend sandbox validation to detect relative paths (./,  ../, ..)
and reject any path containing .. traversal segments before
canonicalization. Also resolves pre-existing build issue by adding
tokio macros feature to zeph-tools dependencies.

Closes #308
@bug-ops bug-ops force-pushed the feat/m14/shell-sandbox-relative branch from 9919354 to cfb32fd Compare February 15, 2026 13:34
@bug-ops bug-ops enabled auto-merge (squash) February 15, 2026 13:40
@bug-ops bug-ops merged commit ed6f3fc into main Feb 15, 2026
17 checks passed
@bug-ops bug-ops deleted the feat/m14/shell-sandbox-relative branch February 15, 2026 13:44
@bug-ops bug-ops mentioned this pull request Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detect relative path traversal in shell executor sandbox

2 participants