IPv6 Zone Bypassed Gotenberg’s SSRF Filter; Fixed in 8.38.0
In Gotenberg 8.31.0–8.37.0, an IPv6 zone could bypass the SSRF filter and reach a local service. The issue was fixed in 8.38.0.
Users running Gotenberg 8.31.0–8.37.0 should update to 8.38.0: an IPv6 zone can bypass the SSRF filter. As Habr reports, details of CVE-2026-126799 were published on November 11. Gotenberg converts HTML and office documents to PDF; in affected versions, a request using a specially crafted address could reach a local service even though the filter was supposed to block it.
Where the Zone Trips Up Address Checks
An IPv6 zone identifies a network interface for a link-local address, as in fe80::1%eth0. In a URL, the percent sign is encoded, producing http://[fe80::1%25eth0]/. Go parses the URL, retains the zone in netip.Addr, and can establish a connection. For addresses outside the link-local range, however, the zone does not change the route, but it can change the outcome of a check.
In the SSRF filter examined here, the application rejects local addresses using netip.Addr methods and a list of blocked prefixes. A key detail of the library’s contract matters here: netip.Prefix.Contains returns false for any address with a zone. Even if the address itself falls within a blocked range, the check will not match. The IsUnspecified() method also takes the zone into account when comparing addresses, so it does not consider ::%1 an unspecified address.
The methods do not all behave the same way. IsLoopback, IsPrivate, and IsLinkLocalUnicast handle the address differently and still recognize their respective cases when a zone is present. That is why the filter blocks ::1%lo but lets ::%1 through. Likewise, fec0:1234::3 falls within a blocked prefix, while fec0:1234::3%1 does not match it. The author got the same result with Go 1.26.11 and 1.27.4: upgrading to those releases alone does not fix this check.
What Happened When the Service Connected
To reproduce the issue, the author built a link preview service that checks a URL before fetching the page. An internal HTTP service was running alongside it on the IPv6 loopback interface. The check rejected direct requests to 127.0.0.1, localhost, [::1], and [::]. But http://[::%251]:9999/ passed the filter: the preview service connected to [::1]:9999 and returned the internal service’s response to the outside world.
The zones lo and zzz also worked in the same run. No interface named zzz existed on the system, but for this address, the zone did not prevent the connection. That does not mean the technique can reach any localhost service: the author could not connect through [::] to a service bound only to 127.0.0.1. The service reached in the test was listening on IPv6 loopback.
Blocked prefixes, including NAT64 and 6to4, were tested separately. The old function allowed addresses with zones from those ranges through; the author did not test an actual connection to a NAT64 network. That distinction matters: a classifier test demonstrates a filter bypass, not that a particular internal network is reachable.
What Services That Accept URLs Should Do
For developers of link previews, webhooks, URL-based importers, and image proxies, the fix starts with normalizing the address. Remove the zone with addr.WithZone("") before classifying it, so prefix checks and IsUnspecified() receive an address without a zone. If the service blocks link-local addresses anyway, it can reject URLs with zones outright. For Gotenberg, the version boundary is clear: affected releases end at 8.37.0, and the fix is in 8.38.0.
But checking before the request is not enough. DNS could return a different address afterward, or the HTTP client could follow a redirect. In the author’s example, an additional check in net.Dialer.Control stopped a connection that the initial filter had allowed. It runs when the connection is attempted and must also classify the address without its zone. The proxy is disabled in this configuration; otherwise, the check would see the proxy’s address instead of the target’s.
Regression tests should use pairs of addresses with and without zones: :: and ::%1, addresses from blocked prefixes, and IPv4-mapped IPv6 addresses. A test of the function confirms that internal addresses are blocked and external ones are allowed; a separate run of the service showed that an external link still opened after the fix. That tests not only the block but also whether the filter has broken ordinary requests.
My Take
What strikes me here is not the unusual URL syntax, but the difference between neighboring methods in the same library. One ignores the zone, another takes it into account, and a third will not compare the address with a prefix at all. The code looks tidy until you discover that its tidy parts interpret the same input differently. A great way to get a surprise without a single suspicious-looking construct.
I would not trust SSRF protection to a check performed only at the start of URL processing. Normalization, rejecting zones you do not need, and checking at connection time look less elegant than one short switch. But they make the request pass a check at the point where the server is actually about to connect to the network. It makes the code a little less pretty; an internal service’s response making it outside can ruin your day much more thoroughly.
Sources
Where the news comes from. The text is a retelling in the author’s own words; the facts come from the source, the opinion is the author’s.
Experienced backend developer
I work on web application performance and infrastructure for small products. I like tools that don’t require a separate specialist just to maintain the tool itself.
All posts by the authorRelated articles
Two Critical NGINX Vulnerabilities Allow Code Execution via HTTP/2
F5 has patched two critical NGINX HTTP/2 vulnerabilities that could allow unauthenticated code execution on the server. Administrators should check their versions and update affected instances.
Audit of 284 Russian Websites Finds Email, DNS and Data Protection Issues
An audit of 284 websites run by major Russian organizations found issues with DMARC, DNS, outdated libraries and third-party services. Automated findings still need manual verification.
Linux Kernel Vulnerability Allows Attacks via Incoming TCP Connections
A critical Linux kernel flaw allows attackers to target servers through incoming TCP connections without a password. Server owners should check their distribution’s patch status and install the update.
Discussion 4
Ramin Aliyev
One useful regression test here is to assert the policy on the parsed `netip.Addr` itself, including addresses with a zone, rather than only testing URL parsing. Otherwise the fix lands, the test suite stays green, and the next refactor quietly reintroduces the same little escape hatch.
Hayk Ohanyan
@ramin.api, would you include a case where the zone is attached to an address outside the link-local range too? That seems like the tricky part: the zone shouldn’t change the route, but it can still affect the address check.
Ilie Negru
I’ve seen the same class of bug in URL fetchers: the hostname passed validation, then the dialer resolved it differently than expected. We now check the parsed IP again at connect time and reject any zone identifier unless the use case explicitly needs one.
Tomas Vaičiūnas
The URL can pass the bouncer, then the dialer checks its ID at the door—and IPv6 zones are apparently very good at borrowing someone else’s badge. Rechecking the parsed IP at connect time, and rejecting zones unless they’re genuinely needed, sounds like the right kind of paranoia for a URL fetcher.