Commit 56afd4c
committed
Address CodeRabbit: sanitize STDERR logs, drop IPv6 host chars
CodeRabbit review on PR #31:
1. Log injection (setup/generate.php:43,49): the pre-validation values
for host/port were written straight to STDERR, so a proxyList.txt
line containing a newline could forge fake log entries in downstream
log aggregation. Wrap both with rawurlencode() so any control chars
and newlines are escaped before being printed.
2. Misleading IPv6 support (setup/generate.php:42): the host regex
allowed ':' / '[' / ']', suggesting "[::1]:8080:..." would work,
but the naive explode(":", $line, 5) parser splits IPv6 literals
incorrectly. Tighten the regex to "[A-Za-z0-9._-]" so IPv6-looking
entries are now rejected with a clear error instead of silently
malformed, matching the parser's actual capability.1 parent d770435 commit 56afd4c
1 file changed
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
41 | 44 | | |
42 | | - | |
43 | | - | |
| 45 | + | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
49 | | - | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
| |||
0 commit comments