lsp/runtime: add failing test proving LspRuntime._read_file has no workspace path containment check #10736
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!10736
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "test/issue-10489-lsp-path-containment-tdd"
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
This PR adds a TDD test that proves
LspRuntime._read_file()lacks workspace path containment validation, creating a path traversal security vulnerability. The test uses the@tdd_expected_failtag to pass in CI while documenting the bug.Changes
features/tdd_lsp_path_containment.feature- New Behave feature file with a@tdd_expected_failscenario that demonstrates the vulnerability by attempting path traversal outside the workspace.features/steps/tdd_lsp_path_containment_steps.py- Step definitions usinglsp_pcprefix to avoid AmbiguousStep errors.Security Impact
LspRuntime._read_file()is a@staticmethodwith no workspace parameter, making it impossible to perform containment checks. An attacker controllingfile_pathcould read arbitrary files.Testing
All quality gates pass: lint, typecheck, unit_tests (638 features passed, 15,238 scenarios passed).
Closes #10489
Automated by CleverAgents Bot
Supervisor: Implementation Pool | Agent: implementation-worker
All tests added for TDD issue #10489 have been reviewed and correctly demonstrate the missing workspace path containment check. No blocking issues found.
Suggestions for improvement:
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker
e1b091de3574365722f874365722f831ce06bd0eImplementation Attempt — Tier 1: haiku — Success
Fixed two issues in the TDD test for LspRuntime._read_file path containment (bug #10490):
Corrected TDD tag: Changed
@tdd_issue_10489→@tdd_issue_10490so the tag references the actual bug issue (path traversal vulnerability) rather than the TDD testing issue itself. This is required for CI to validate the tag when the bug fix PR is submitted.Added safe-file scenario: Added a new scenario "_read_file can read a file inside the workspace" that verifies
_read_filesuccessfully reads files within the workspace directory. This addresses the reviewer suggestion from HAL9001.Also updated all docstrings and comments to reference bug #10490 consistently.
Quality gate status: lint ✓, typecheck ✓, unit_tests — our changes pass (1 pre-existing failure in
ci_workflow_validationunrelated to this PR)Automated by CleverAgents Bot
Supervisor: Implementation | Agent: implementation-worker
322c170f62b7a5913f46b7a5913f468f4c53504e8f4c53504e58ba6b681758ba6b6817600112692b600112692b14f2395f1e14f2395f1e21c2a8db8f21c2a8db8fb725bc415db725bc415db7d9aba5d3b7d9aba5d39f4f660d4aImplementation Attempt — Tier 3: sonnet — Success
Fixed the CI lint failure caused by a ruff format check violation in
features/steps/tdd_lsp_path_containment_steps.py.Root cause: The CI lint job runs both
nox -s lint(ruff check) andnox -s format -- --check(ruff format check). The step definitions file had a multi-line f-string assertion that ruff format wanted to merge into a single line:Fix applied: Ran
nox -s formatto auto-apply ruff formatting, then committed and force-pushed the single-line change.Quality gate status: lint ✓ (ruff check + ruff format --check), security_scan ✓, dead_code ✓, complexity ✓
Automated by CleverAgents Bot
Supervisor: Implementation | Agent: implementation-worker
c8ade53b9a126617faf7126617faf7b2c8e79689b2c8e79689446f447c03