fix(security): fix file_tools.py validate_path startswith bypass #7478 #11214
No reviewers
Labels
No labels
auto/needs-reevaluation
controller-managed
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cleveragents/cleveragents-core!11214
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/m1-security-fix-startswith-bypass"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes path traversal vulnerability (#7478) where string-based
startswith()checks could be evaded via the prefix-collision bypass.Files Changed
validate_sandbox_path()_safe_resolve()_write_to_sandbox()All replaced
startswith()string checks withPath.relative_to().Quality Gates
Closes #7478
PR Review Summary — #11214: fix(security): fix file_tools.py validate_path startswith bypass
VERDICT: APPROVED
The core security fix is correct and well-scoped. All three call sites replace the vulnerable
startswith()string prefix check withPath.relative_to(), which properly resolves symlinks and eliminates the prefix-collision path traversal bypass.Category Breakdown
Path.relative_to(root)after.resolve()is the proper guard. All three locations fixed consistently (file_ops.py, _base.py, llm_actors.py).Pathimport added at top of llm_actors.py. Exception chaining viafrom excis correct. No# type: ignore.resolve()andrelative_to()are O(depth) ops, same class as string prefix check. No regression.from excchaining), no magic numbers, follows ruff conventions.nullstate (no checks have run yet). Author should ensure CI completes before merge. Otherwise: atomic, single-concern change.Observations
null— the workflow has not completed (may not even have started). The PR claims quality gates passed but CI has not run yet. Recommend waiting for CI to pass before merging.features/covering a path like/tmp/abc-prefix-escapeagainst a root of/tmp/abc— this was the exact bypass vector fixed.Conclusion
Core security fix is correct, well-targeted, and properly aligned with #7478. APPROVED pending CI completion.
CI jobs still show
nullstate — the workflow has not completed (run #20725). The commit was made on May 14 and the PR is stale (stale_state: stale_no_conflicts). Recommend the author force-push or add a trivial commit to trigger CI, then wait for all 12 checks to pass before merging.Also: no labels applied (empty
labelsarray) andmilestoneis null. Please setType/Securitylabel and assign an appropriate milestone.bcb24b103c55a6169dda