snappymail/test
djmaze 650133ae8a @ZaphodB fix(security): SSRF gate let through CGNAT, multicast and the server's own IPs
URIHasPublicHost() relied on FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE
alone. On PHP 8.4 that passes 100.64.0.0/10 (shared space: CGNAT, Tailscale,
Alibaba metadata at 100.100.100.200), 192.0.0.0/24, 198.18.0.0/15,
224.0.0.0/4, fec0::/10 and ff00::/8. It also passed the server's own public
addresses: a fetch to them never leaves the host, so it reaches services that
listen on every address but are firewalled from outside (on our host: grafana,
forgejo, prometheus and the exporters).

Both checks, on the literal host and on every resolved address, now go through
IsPublicIP(): PHP's flags, then an explicit list of the ranges above, then the
addresses net_get_interfaces() reports for this host (cached per request).

test/ssrf-ranges.php checks the new ranges and their edges, that ordinary
public addresses still pass, and the own-address rule via the cache. Before
this change 100.64.0.1 was treated as public. DNS rebinding between check and
connect is still not covered; that needs the connection pinned to the checked
address.
2026-10-27 01:30:31 +01:00
..
carddav.php Test CardDAV for #79 2021-04-15 12:41:01 +02:00
crypt-forgery.php Not Tachyon 2026-10-26 00:39:16 +01:00
header-injection.php Not Tachyon 2026-10-26 00:39:16 +01:00
raw-inline-type.php Not Tachyon 2026-10-26 00:39:16 +01:00
sasl.php Resolve #695 2022-11-23 16:26:26 +01:00
smime-verify.php Not Tachyon 2026-10-26 00:39:16 +01:00
sso.php Use SNAPPYMAIL_INCLUDE_AS_API and added SSO test 2022-01-10 16:10:56 +01:00
ssrf-ranges.php @ZaphodB fix(security): SSRF gate let through CGNAT, multicast and the server's own IPs 2026-10-27 01:30:31 +01:00