Commit 96c0401
committed
fix: prevent path traversal in downloadJobArtifacts local_path
downloadJobArtifacts() joined the caller-controlled local_path
argument (download_job_artifacts MCP tool) directly into the
filesystem save path with no validation, allowing an absolute path
or ../ traversal sequence to write the artifact zip anywhere the
process has permission to write.
Apply the same normalize/validate check already used by
downloadAttachment() for its localPath parameter: reject absolute
paths, "..", and any path escaping the intended base directory.1 parent 926d42c commit 96c0401
1 file changed
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7486 | 7486 | | |
7487 | 7487 | | |
7488 | 7488 | | |
7489 | | - | |
| 7489 | + | |
| 7490 | + | |
| 7491 | + | |
| 7492 | + | |
| 7493 | + | |
| 7494 | + | |
| 7495 | + | |
| 7496 | + | |
| 7497 | + | |
| 7498 | + | |
| 7499 | + | |
| 7500 | + | |
| 7501 | + | |
| 7502 | + | |
| 7503 | + | |
7490 | 7504 | | |
7491 | 7505 | | |
7492 | 7506 | | |
| |||
0 commit comments