From 51dd4b7178904267e37886fed3b85e54f9be919f Mon Sep 17 00:00:00 2001 From: matthew-pilot Date: Thu, 28 May 2026 16:39:02 +0000 Subject: [PATCH] fix: reject path traversal in data-exchange-demo.sh FILE_PATH (PILOT-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. --- cli/data-exchange-demo.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/cli/data-exchange-demo.sh b/cli/data-exchange-demo.sh index b4192f0..2094624 100755 --- a/cli/data-exchange-demo.sh +++ b/cli/data-exchange-demo.sh @@ -53,6 +53,7 @@ while true; do 3) read -p "\nFile path: " FILE_PATH + if echo "$FILE_PATH" | grep -q '\.\.'; then echo "Error: Path traversal rejected" && continue; fi [ ! -f "$FILE_PATH" ] && echo "Error: File not found" && continue RESULT=$(pilotctl --json send-file "$TARGET_NODE" "$FILE_PATH") if [ $? -eq 0 ]; then