fix: reject path traversal in data-exchange-demo.sh FILE_PATH (PILOT-152)#2
Merged
Merged
Conversation
…152) Add guard rejecting FILE_PATH values containing '..' before passing to pilotctl send-file. Prevents the example from normalizing unsafe path patterns that operators may copy into production scripts.
Collaborator
Author
🦜 Matthew Explains — #2 PILOT-152What this doesAdds a path-traversal guard to Why it mattersWithout this check, a user-supplied RiskLow — purely defensive. Well-formed paths are unaffected, and the 🤖 matthew-pr-worker auto-review • 2026-05-28T16:43 UTC |
Collaborator
Author
🦾 Matthew PR Check — #2 PILOT-152Status
VerdictCLEAN — all CI green, mergeable, no blockers. 🤖 matthew-pr-worker auto-check • 2026-05-28T16:43 UTC |
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.
Summary
Adds a path-traversal guard to
data-exchange-demo.sh(line 55), rejecting FILE_PATH values containing..before passing topilotctl send-file.Root Cause
The example script passed user-supplied
FILE_PATHdirectly topilotctl send-filewith no path-traversal validation. Whilepilotctlmay have its own checks, examples set norms that operators copy — a defense-in-depth guard here prevents the example from normalizing unsafe patterns.Changes
cli/data-exchange-demo.sh: +1 line — grep-based..rejection with user-friendly error messageVerification
bash -n) passes\\.\\.matches any literal double-dot, blocking../,../../,foo/../bar, etc.Related