Bug Description
parseIPv6() mis-encodes valid IPv6 literals that end with an embedded IPv4 address
Reproducible By
import { parseIPv6 } from "undici/lib/core/socks5-utils.js";
console.log(parseIPv6("::ffff:192.0.2.128").toString("hex"));
Expected Behavior
parseIPv6('::ffff:192.0.2.128') should return the correct 16-byte IPv6 encoding for an IPv4-mapped IPv6 address:
00000000000000000000ffffc0000280
Verified using Python's standard library
python3 - <<'PY'
import ipaddress
print(ipaddress.IPv6Address('::ffff:192.0.2.128').packed.hex())
PY
Logs & Screenshots
000000000000000000000000ffff0192
Environment
macOS 26.4.1
Node v24.15.0
undici v8.1.0
Bug Description
parseIPv6() mis-encodes valid IPv6 literals that end with an embedded IPv4 address
Reproducible By
Expected Behavior
parseIPv6('::ffff:192.0.2.128') should return the correct 16-byte IPv6 encoding for an IPv4-mapped IPv6 address:
00000000000000000000ffffc0000280Verified using Python's standard library
Logs & Screenshots
000000000000000000000000ffff0192Environment
macOS 26.4.1
Node v24.15.0
undici v8.1.0