Skip to content

[Review] Path traversal in _run_file_exists — criterion path not confined to project_dir #88

@github-actions

Description

@github-actions

Review Finding

PR: #75 (feat: MCP server source control + 5 new session tools)
File: src/atlas_session/contract/verifier.py
Line: 100
Severity: must-fix

Description

full_path = Path(project_dir) / path where path is taken directly from the user-supplied criterion dict. A path of ../../etc/shadow would resolve outside the project. Add a check that full_path.resolve() is a descendant of Path(project_dir).resolve() before calling .exists().


Auto-created by Claude Code Review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    review-blockingBlocks PR merge until resolved

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions