02 / DIFFERENTIAL
GovsNode
| Test URL | Observed difference |
|---|---|
http:evil.com | Node → host=evil.com, path=/; Go → host='', path=evil.com (opaque URL) |
http:\\evil.com\hello | Node → normalizes \ to /, host=evil.com, path=/hello; Go → opaque URL with backslashes in path |
http:/evil.com | Node → host=evil.com, path=/; Go → host='', path=/evil.com |
http://example.com/ | Node → host=example.com (NFKC-normalizes fullwidth dot); Go → host=example.com (raw) |
http://exmp.com/#hello\n\rSet-Cookie: evil | Node → strips raw CR/LF, percent-encodes spaces in fragment; Go → keeps CR/LF and spaces raw in fragment |
http://exmp.com/?hello=\n\rSet-Cookie: evil | Node → strips raw CR/LF, percent-encodes spaces in query; Go → keeps CR/LF and spaces raw in query |
file://localhost/c:/hello | Node → host='', path=c:/hello (drops the particular hostname for localhost when path starts with [a-zA-Z]:/); Go → host=localhost, path=/c:/hello |
file:hello//etc/passwd | Node → host='', path=hello//etc/passwd; Go → host='', opaque URL (not treated as host+path) |
http://127.1 | Node → host=127.0.0.1 (normalizes integer IPs); Go → host=127.1 (raw) |
http://2130706433/a | Node → host=127.0.0.1; Go → host=2130706433 (raw) |
http://0x7f000001/a | Node → 127.0.0.1; Go → 0x7f000001 (raw) |
http://0177.0.0.1/a | Node → 127.0.0.1; Go → 0177.0.0.1 (raw) |
http://017700000001/a | Node → 127.0.0.1; Go → 017700000001 (raw) |
http://1234567890/a | Node → 73.150.2.210 (decimal→IP); Go → 1234567890 (unchanged) |
http://bücher.com/ | Node → host=xn--bcher-kva.com (Punycode); Go → host=bücher.com (raw) |
https://exmp.com/hello/../world | Node → path=/world (normalizes dot-segments); Go → path=/hello/../world (raw) |