Skip to content

Commit ad6ed06

Browse files
fix(install.sh): validate EMAIL against shell/XML injection (PILOT-245) (#175)
${EMAIL} is written unquoted into systemd ExecStart= and unescaped into macOS plist <string> elements. A malicious email containing shell metacharacters (spaces, semicolons, pipes) or XML metacharacters (<, >, &) can inject additional command-line arguments or break out of the plist structure. Fix: validate EMAIL against ^[A-Za-z0-9@._+-]+$ after resolution and refuse install with a clear error if it contains unsafe characters. Closes PILOT-245
1 parent 6034af2 commit ad6ed06

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

install.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,15 @@ if [ -z "$EMAIL" ] && [ ! -x "$BIN_DIR/pilotctl" ]; then
185185
fi
186186
fi
187187

188+
# --- Validate email (prevent shell/XML injection) ---
189+
190+
if [ -n "$EMAIL" ]; then
191+
if ! echo "$EMAIL" | grep -qE '^[A-Za-z0-9@._+-]+$'; then
192+
echo " Error: EMAIL contains invalid characters (only A-Z a-z 0-9 @ . _ + - allowed)"
193+
exit 1
194+
fi
195+
fi
196+
188197
# --- Detect existing installation ---
189198

190199
UPDATING=false

0 commit comments

Comments
 (0)