fix(memory): reject path-escaping agent IDs - #128
Draft
cursor[bot] wants to merge 2 commits into
Draft
Conversation
Validate agent_id as a single path segment before joining under chat/memory, so stdio memory_write/search cannot create SQLite files outside the chat root via absolute or traversal IDs. Co-authored-by: EXboy <EXboys@users.noreply.github.com>
Record validation results, mark TASK-2026-076 done, and sync the board. Co-authored-by: EXboy <EXboys@users.noreply.github.com>
17 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
memory_write/memory_searchjoined unvalidatedagent_idintomemory/{agent_id}.sqlite. Absolute IDs (e.g./tmp/pwn) replace the memory root viaPath::join, creating/opening SQLite files outside the chat tree; traversal IDs escape the same way.validate_agent_id, makesindex_pathfallible with post-join containment check, and fail-closes executor RPC plus agent memory indexing callers.Bug Impact
<chat_root>/memory/under process permissions.memory_writewithagent_id: "/tmp/pwn"(or../../../tmp/pwn) and a validrel_path/content.Task Linkage
TASK-2026-076tasks/TASK-2026-076-memory-agent-id-path-safety/Injected Specs
spec/verification-integrity.mdspec/task-artifact-language.mdspec/security-nonnegotiables.mdspec/rust-conventions.mdspec/testing-policy.mdspec/docs-sync.md(N/A: fail-closed validation only; no user-facing path grammar docs)spec/architecture-boundaries.md(reviewed; no boundary changes)Validation Evidence
cargo fmt --all -- --check→ cleancargo test -p skilllite-core path_validation→ 2 passedcargo test -p skilllite-executor --lib→ 6 passedcargo test -p skilllite-agent --lib→ 247 passedcargo clippy -p skilllite-core -p skilllite-executor -p skilllite-agent --all-targets -- -D warnings→ cleanpython3 scripts/validate_tasks.py→ passed (71 task directories)/tmp/pwnand traversal../../../tmp/pwnrejecteddefaultstill resolves undermemory/default.sqliteRegression Scope
Docs Sync (EN/ZH)
Files:
Security Review Notes
SKILLLITE_*config semantics? No.Review Checklist
tasks/TASK-2026-076-memory-agent-id-path-safety/TASK.mdsatisfiedtasks/TASK-2026-076-memory-agent-id-path-safety/STATUS.mdupdated with latest progresstasks/TASK-2026-076-memory-agent-id-path-safety/REVIEW.mdincludes merge readiness decisiontasks/board.mdstatus is up to date