bug: Absolute `prdPath` allows arbitrary file read outside the project root · Issue #1715 · eyaltoledano/claude-task-master · GitHub
Skip to content

bug: Absolute prdPath allows arbitrary file read outside the project root #1715

Open

Description

@pzr21

Description

claude-task-master has a path traversal vulnerability in parsePrdToHamster. When prdPath is absolute, the function accepts it directly and reads the file without requiring it to be inside the project root. The PRD content is then forwarded to downstream integration logic, creating an arbitrary local file read and exfiltration primitive for files readable by the process.

Steps to Reproduce

Prepare a project root and a separate file outside it:

projectRoot=/tmp/ctm-prd-path-poc/safe-project-root
outside file=/tmp/ctm-prd-path-poc/outside-secret.txt
outside content=CTM-PRD-SECRET

Call the PRD parsing flow with an absolute prdPath outside projectRoot:

{
  "prdPath": "/tmp/ctm-prd-path-poc/outside-secret.txt",
  "projectRoot": "/tmp/ctm-prd-path-poc/safe-project-root"
}

The same boundary issue also applies to relative paths that resolve outside the project root, such as ../outside-secret.txt, if accepted by the caller.

Expected Behavior

PRD input and output paths should be resolved to canonical paths and rejected unless the final path remains inside projectRoot. Absolute paths outside the project root and relative traversal paths should not be accepted.

Actual Behavior

The out-of-root file is accepted as the PRD input and its content is read:

read_content=CTM-PRD-SECRET

The boundary check fails even though the file is outside projectRoot:

prdPath=/tmp/ctm-prd-path-poc/outside-secret.txt
projectRoot=/tmp/ctm-prd-path-poc/safe-project-root

Environment

  • Task Master version: 0.43.1 (c0c98d367c55296bfe69e65680625b6db437af02)
  • Node.js version: v20.18.1
  • Operating system: Ubuntu 22.04 LTS, Linux 6.5.13-5-pve x86_64
  • IDE (if applicable): VS Code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions