mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
Security review of #106 surfaced two HIGH-severity gaps in the SSRF guard. Both are documented bypass classes with public CVE precedent (github.com/projectdiscovery/nuclei-templates' SSRF templates list hex and IPv4-mapped IPv6 explicitly). - Hex-notation IPv4: 'http://0x7f.0.0.1' / 'http://0x7f000001' / 'http://0xa.0.0.1' all parse to internal addresses depending on the runtime's URL semantics. Reject the raw form before parsing. - Decimal-notation IPv4: 'http://2130706433' is 127.0.0.1, etc. Reject any pure-numeric host of plausible IP length. - IPv4-mapped IPv6: '[::ffff:127.0.0.1]' and the hex variant '[::ffff:7f00:1]' both target loopback. Match either form and apply the private-IPv4 check to the embedded address. - '[::]' (IPv6 unspecified, alias for 0.0.0.0) blocked alongside '[::1]'. Refactored the per-octet private-range checks into isPrivateIpv4() since both the IPv4 and the IPv4-mapped-IPv6 paths now use them. Test suite extended with regression cases for hex, decimal, and IPv4-mapped IPv6. Now 208/208 passing.