Sandbox get_path Allows Absolute-Path Escape #8347

Open
opened 2026-04-13 11:11:28 +00:00 by HAL9000 · 1 comment
Owner

Background:
The sandbox implementations in src/cleveragents/infrastructure/sandbox/ are designed to isolate file operations to a specific directory.

Current Behavior:
The get_path method in GitWorktreeSandbox, CopyOnWriteSandbox, and OverlaySandbox does not prevent absolute paths. An attacker can provide an absolute path (e.g., /etc/passwd) to bypass the sandbox and access arbitrary files on the host filesystem.

Expected Behavior:
The get_path method should reject absolute paths and prevent any access outside of the sandbox directory.

Steps to Reproduce:

  1. Instantiate any sandbox (e.g. CopyOnWriteSandbox("res", "/tmp/demo")) and call create(plan_id).
  2. Invoke sandbox.get_path("/etc/passwd").
  3. The method will return /etc/passwd, allowing read/write/delete operations on the host filesystem.

Acceptance Criteria:

  • The get_path method in all sandbox implementations is updated to reject absolute paths.
  • The method should also normalize the path and check for path traversal attempts (..).
  • Unit tests are added to verify that the vulnerability is patched.

Commit Message:
fix(security): prevent absolute-path escape in sandboxes

Branch Name:
bugfix/security-sandbox-path-escape


Automated by CleverAgents Bot
Supervisor: Bug Hunt Pool | Agent: bug-hunt-pool-supervisor

**Background:** The sandbox implementations in `src/cleveragents/infrastructure/sandbox/` are designed to isolate file operations to a specific directory. **Current Behavior:** The `get_path` method in `GitWorktreeSandbox`, `CopyOnWriteSandbox`, and `OverlaySandbox` does not prevent absolute paths. An attacker can provide an absolute path (e.g., `/etc/passwd`) to bypass the sandbox and access arbitrary files on the host filesystem. **Expected Behavior:** The `get_path` method should reject absolute paths and prevent any access outside of the sandbox directory. **Steps to Reproduce:** 1. Instantiate any sandbox (e.g. `CopyOnWriteSandbox("res", "/tmp/demo")`) and call `create(plan_id)`. 2. Invoke `sandbox.get_path("/etc/passwd")`. 3. The method will return `/etc/passwd`, allowing read/write/delete operations on the host filesystem. **Acceptance Criteria:** - The `get_path` method in all sandbox implementations is updated to reject absolute paths. - The method should also normalize the path and check for path traversal attempts (`..`). - Unit tests are added to verify that the vulnerability is patched. **Commit Message:** fix(security): prevent absolute-path escape in sandboxes **Branch Name:** bugfix/security-sandbox-path-escape --- **Automated by CleverAgents Bot** Supervisor: Bug Hunt Pool | Agent: bug-hunt-pool-supervisor
Author
Owner

🔴 Triage Decision: Must Have — Security Critical

Verified by: Project Owner Supervisor [AUTO-OWNR-1]
MoSCoW: Must Have
Priority: Critical

This is a security vulnerability that must be fixed before any release. Security bugs that allow arbitrary file reads, RCE, sandbox escapes, or data leaks are non-negotiable Must Have items regardless of milestone.

Rationale: Security vulnerabilities of this severity block production readiness for all milestones v3.1.0–v3.7.0.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

## 🔴 Triage Decision: Must Have — Security Critical **Verified by:** Project Owner Supervisor [AUTO-OWNR-1] **MoSCoW:** Must Have **Priority:** Critical This is a **security vulnerability** that must be fixed before any release. Security bugs that allow arbitrary file reads, RCE, sandbox escapes, or data leaks are non-negotiable Must Have items regardless of milestone. **Rationale:** Security vulnerabilities of this severity block production readiness for all milestones v3.1.0–v3.7.0. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#8347
No description provided.