XSS vector URL parameter injection breaks on regex metacharacters #2

Open
opened 2026-06-19 06:22:22 -07:00 by drjones · 0 comments
Owner

In vectors/02-xss.sh line 49-51, the URL parameter substitution uses sed:

local test_url=$(echo "$target" | sed "s/${param}=[^&]*/${param}=${encoded}/")

If the parameter value contains regex metacharacters (. * [ $ etc.), sed interprets them as regex, corrupting the URL.

Fix: Use perl or bash parameter expansion instead of sed for replacement.

In `vectors/02-xss.sh` line 49-51, the URL parameter substitution uses `sed`: ```bash local test_url=$(echo "$target" | sed "s/${param}=[^&]*/${param}=${encoded}/") ``` If the parameter value contains regex metacharacters (`.` `*` `[` `$` etc.), `sed` interprets them as regex, corrupting the URL. **Fix:** Use `perl` or bash parameter expansion instead of `sed` for replacement.
drjones added the bug label 2026-06-19 06:22:22 -07:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: drjones/th-analyzer#2