The validator was sixty-eight lines and a filter_var call
PR #14101, "[5.x] External Glide URL validation," landed February 27, 2026. It introduced RemoteUrlValidator to gate the only external-input surface the Glide image proxy exposes: the watermark parameter on an image-generation request, and any Glide call that fetches an image by URL. A request like /img/asset/...?mark=https://example.com/wm.png reaches Statamic\Imaging\ImageGenerator::setUpWatermark, which routes the watermark URL through getWatermarkFilesystemAndParam → parseUrl → app(RemoteUrlValidator::class)->parse($url). The validator's job, end to end, is to refuse anything that resolves to an internal address before Guzzle dials it. CVE-2026-45660 is the case it does not refuse.
// src/Imaging/RemoteUrlValidator.php (pre-patch, v5.73.21)
protected function ensureHostResolvesToPublicIps($host)
{
if (filter_var($host, FILTER_VALIDATE_IP)) {
$this->assertPublicIp($host);
return;
}
$records = call_user_func($this->resolver, $host);
$ips = collect($records)->flatMap(function ($record) {
return [$record['ip'] ?? null, $record['ipv6'] ?? null];
})->filter()->values()->all();
if (empty($ips)) {
throw new InvalidRemoteUrlException('Unable to resolve URL host.');
}
foreach ($ips as $ip) {
$this->assertPublicIp($ip);
}
}
protected function assertPublicIp($ip)
{
$result = filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE);
if (! $result) {
throw new InvalidRemoteUrlException('Destination IP is not publicly routable.');
}
}
Two filter_var calls. The first proves the resolved value is a syntactically valid IP. The second proves the IP is not in FILTER_FLAG_NO_PRIV_RANGE (RFC 1918, RFC 4193) and not in FILTER_FLAG_NO_RES_RANGE (loopback, link-local, IETF-reserved blocks). The flag set is what PHP's filter extension publishes as "not private, not reserved." Statamic took PHP at its word.
The default resolver, declared on the constructor as fn ($host) => dns_get_record($host, DNS_A + DNS_AAAA) ?: [], walks both A and AAAA records and hands each back as either the ip or ipv6 key of the resolver's array. assertPublicIp then runs the same predicate against either form. The flag-name pair is one constant; the address space the constant covers depends on which family the string parses as. That is where the gap lives.
::ffff:169.254.169.254 passes the gate
PHP's filter_var with the two range flags, on every PHP release before 8.3, runs the predicate against the address as named. An IPv6 string is matched against IPv6 range tables. Those tables enumerate the IPv6 spaces RFC 4291 and RFC 6890 list as reserved: ::1/128 for loopback, fe80::/10 for link-local, fc00::/7 for unique-local, and the documented IETF allocations. They do not enumerate the ::ffff:0:0/96 prefix that RFC 4291 sets aside for IPv4-mapped IPv6, which is the representation a dual-stack system uses to carry an IPv4 address inside an IPv6 socket.
::ffff:169.254.169.254 is one such address. It is the IPv6 representation of 169.254.169.254. On every cloud provider that follows the EC2 convention, including AWS, Alibaba, Hetzner, Scaleway, and DigitalOcean, that IPv4 is the instance metadata service. The validator runs:
filter_var('::ffff:169.254.169.254', FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)
=> '::ffff:169.254.169.254' // returned as a valid public IP
No exception. parseUrl returns. ImageGenerator constructs GuzzleAdapter against https://attacker.example. Guzzle's underlying curl handle resolves attacker.example through the OS resolver, receives the same IPv4-mapped IPv6 sockaddr from getaddrinfo, and connect()s. Linux's dual-stack socket (IPV6_V6ONLY=0, the default) recognises the ::ffff: prefix and dispatches the connection over IPv4 to 169.254.169.254. The kernel does the unwrap the validator did not.
The attacker's choice of address is not constrained to the metadata endpoint. The same path reaches every host the dual-stack kernel will route to over the unwrapped IPv4, which is every IPv4 host the validator was written to refuse: 127.0.0.1, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, and every host on a private VLAN bound to the Statamic server's network interfaces. The regression test that ships with the fix names what the author was thinking about when they wrote it:
// tests/Imaging/ImageGeneratorTest.php (added in v5.73.22)
public static function ipv4MappedIpv6Provider()
{
return [
'mapped loopback' => ['::ffff:127.0.0.1'],
'mapped loopback (hex form)' => ['::ffff:7f00:1'],
'mapped RFC1918' => ['::ffff:10.0.0.1'],
'mapped link-local metadata' => ['::ffff:169.254.169.254'],
];
}
Four entries. Loopback, loopback in compressed hex, an RFC 1918 private range, and the address the test names "link-local metadata." The data provider's key strings are the test author saying out loud which address the fix is for.
The redirect path runs the same predicate
GuzzleAdapter::requestOptions returns a Guzzle option array that registers a callback on every 30x:
return [
'allow_redirects' => [
'on_redirect' => function ($request, $response, $uri) {
app(RemoteUrlValidator::class)->validate((string) $uri);
},
],
];
The author considered the redirect-to-internal class. The callback re-validates the redirect target. The callback uses the same RemoteUrlValidator. A target server can serve a 302 to http://[::ffff:169.254.169.254]/, and the redirect validator returns clean against the IPv6 form the same way the initial validator did. The defense against redirect-based SSRF is in the file; the bug class is in the file's only validator.
The bytes Guzzle reads after the connect are handed to Glide as a watermark source. Glide attempts to decode them as an image and fails when the response is JSON or plaintext, which is what every IMDS endpoint returns. The 500 the operator sees is not a successful watermark render. The GET that produced it is what the attacker came for: blind SSRF against the IMDS endpoint is sufficient to trigger any side effect on an internal HTTP API that responds to unauthenticated GET, and on IMDSv1 it is sufficient to retrieve IAM Role credentials through a follow-on connection from the same attacker-controlled domain whose DNS the validator obeys.
The seven-line patch is the canonicalization PHP 8.3 already did
The 5.73.22 diff to assertPublicIp:
protected function assertPublicIp($ip)
{
+ if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
+ $packed = inet_pton($ip);
+ if ($packed !== false && substr($packed, 0, 12) === "\0\0\0\0\0\0\0\0\0\0\xff\xff") {
+ $ip = inet_ntop(substr($packed, 12));
+ }
+ }
+
$result = filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE);
if (! $result) {
throw new InvalidRemoteUrlException('Destination IP is not publicly routable.');
}
}
Seven added lines. The algorithm: if the address parses as IPv6, pack it into its sixteen-byte representation, inspect the first twelve bytes, and if they match the IPv4-mapped prefix \0\0\0\0\0\0\0\0\0\0\xff\xff, slice the trailing four bytes into the IPv4 dotted form via inet_ntop and reassign $ip. The existing filter_var call below then runs against the unwrapped IPv4 address. 169.254.169.254 lands in FILTER_FLAG_NO_RES_RANGE. The exception fires. The validator now matches what curl was always going to do.
The byte pattern \0\0\0\0\0\0\0\0\0\0\xff\xff is the in-memory shape of the ::ffff:0:0/96 prefix. The patch is inet_pton, a substring compare, and inet_ntop. Each call is a primitive PHP exposes for exactly this purpose. The reason the patch can be seven lines is that the canonicalization is already in PHP; the validator just never reached for it.
The advisory's own remark on the version split:
Sites running PHP 8.3 or newer are not affected.
This is the vendor saying out loud where the gap is. The Statamic validator's two-line check trusted PHP to discriminate between "valid IPv6 in a documented public block" and "valid IPv6 carrying an embedded IPv4 in a documented private block." Before PHP 8.3, the filter extension did not make that distinction; the IPv4-mapped form was not classified as the reserved block its embedded IPv4 belonged to. From PHP 8.3 onward, the filter extension treats the mapped form as the IPv4 address it carries. The Statamic patch is the same canonicalization, written one layer up.
PHP 8.3 was the patch. PHP 8.2 is the CVE.
PHP 8.3 was released November 23, 2023. PHP 8.2 reached end of active support December 8, 2024 and end of security support December 31, 2025. Statamic 5.x's composer.json requires php ^8.2. The vulnerable RemoteUrlValidator shipped February 27, 2026. The fix shipped May 11, 2026. The advisory shipped May 18, 2026.
The deployment slice CVE-2026-45660 describes is every Statamic install whose hosting still serves PHP 8.2, every install on a long-term-support distribution that back-ports security fixes into the 8.2 branch, every install whose operator pinned the runtime older than the one PHP would have done the work in. The not affected line in the advisory is honest about what the upstream had already done; it also names the deployment population that needs the polyfill.
The validator was new. The validator's flags were correct. The bug is older than the validator, and it lives one layer below it.
Gate-before-canonicalize, on filter_var's range flags
The class signature is in the catalog. The check runs against the wrapped representation; the action runs against the unwrapped one. The fix is to canonicalize before checking, never after. The Statamic exhibit puts the disagreement inside PHP's filter extension, where IPv6-form range checks and IPv4-form range checks split across a runtime-version boundary.
The same shape lives across the catalog's prior exhibits with different parser pairs. Open-WebSearch (CVE-2026-42260) wrote the ::ffff:* enumeration into a dispatcher its control flow never reached. Gotenberg (CVE-2026-42596) wrote a deny-list regex against the bracketed-host form and let net/netip.ParseAddr unmap it to loopback IPv4 inside the dial. EspoCRM (CVE-2026-33534) wrote a filter_var(..., FILTER_VALIDATE_IP) host check and let libcurl's inet_aton accept 0177.0.0.1 as the same address with different bytes. Each is the same shape on a different parser pair.
This exhibit moves the disagreement inside a single function, across runtime versions of it. The validator and the kernel use two views of ::ffff:169.254.169.254; the validator runs against the address as a string, the kernel routes against the address as bytes. PHP 8.3's filter extension closes the gap by unwrapping the mapped form before classifying it. Statamic's patch closes the gap by unwrapping the mapped form before passing it to filter_var. Both implement the same canonicalization. The runtime is the layer; the user code is the polyfill.
PoC: GHSA-pf9c-ch8r-2958. Patch commit: 3a0b3a05a in statamic/cms.