Harden artifact download path validation#1185
Open
danmoseley wants to merge 2 commits intomicrosoft:mainfrom
Open
Harden artifact download path validation#1185danmoseley wants to merge 2 commits intomicrosoft:mainfrom
danmoseley wants to merge 2 commits intomicrosoft:mainfrom
Conversation
Keep artifact downloads constrained to safe relative paths, reject artifact names that look like paths, and document the destinationPath behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Make the runtime MCP tool description state that destinationPath must be relative, so clients and agents see the constraint before calling the tool. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1185 +/- ##
=======================================
Coverage ? 90.26%
=======================================
Files ? 19
Lines ? 2126
Branches ? 498
=======================================
Hits ? 1919
Misses ? 111
Partials ? 96
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Note
This PR description was drafted with GitHub Copilot assistance.
Fixes #1181
Clarify and harden path validation for
pipelines_download_artifact.The tool rejects absolute
destinationPathvalues, but agents primarily see runtime MCP tool descriptions rather than repository docs. In Copilot CLI I gotThis PR makes the relative-only requirement visible in both the top-level tool description and the
destinationPathparameter description.It also strengthens validation by treating
artifactNameas a name rather than a path and rejecting path separators, absolute paths, drive-letter syntax, and./..path segments.GitHub issue number
#1181
Associated Risks
This intentionally keeps absolute
destinationPathvalues rejected to avoid arbitrary local write locations. Agents that currently pass absolute paths will receive a clearer pre-call schema description and a clearer validation error.✅ PR Checklist
🧪 How did you test it?
npm test -- --runTestsByPath test/src/tools/pipelines.test.ts --runInBandnpm run validate-tools