bug: Absolute `prdPath` allows arbitrary file read outside the project root
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-SECRETCall 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-SECRETThe 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-rootEnvironment
- 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
Source: eyaltoledano/claude-task-master