Summary
Gotenberg's default private-IP deny-lists for webhooks and remote downloads rely on a case-sensitive regular expression to filter URL schemes, while Go's URL parser normalizes schemes to lowercase before connecting.
By capitalizing parts of the scheme (for example, HTTP:// or Https://), an attacker can bypass the deny-list and coerce Gotenberg into making unauthenticated HTTP requests to internal services and metadata endpoints.
Affected context
This vulnerability affects Gotenberg deployments that:
- Enable webhooks or remote document downloads, and
- Rely on the default
--webhook-deny-listand/or--api-download-from-deny-listprotections for blocking access to private IPs, loopback, and metadata endpoints.
The issue arises in URL validation logic where a case-sensitive regular expression (^https?://) is used to match schemes before outbound requests are made, while Go's net/url.Parse() normalizes the scheme to lowercase during connection setup. Any environment exposing the Gotenberg HTTP API to untrusted clients and depending on these deny-lists to protect internal network boundaries is impacted.
Exploit preconditions
- Attack surface: Gotenberg's HTTP API endpoints that:
- Accept user-provided URLs for webhooks, or
- Accept URLs for downloading source documents.
- Required access: Network access to the Gotenberg API (no authentication is required where these endpoints are publicly exposed).
- Trigger point: Submission of a crafted URL whose scheme uses mixed or upper-case characters (for example,
HTTP://169.254.169.254/...) that: - Does not match the case-sensitive deny-list regex, but
- Is normalized to lowercase by
net/url.Parse()when the HTTP client initiates the outbound connection. - Why exploitation is possible: The security control trusts a case-sensitive pattern match on the original input string to enforce the deny-list, while the actual network layer uses a canonicalized (lowercased) scheme. This mismatch between validation and usage allows attackers to route requests to internal addresses that should have been blocked.
Why this happens
The vulnerability stems from a validation-usage mismatch in URL handling, a common pattern in CWE-918: Server-Side Request Forgery (SSRF) and related input-validation issues.
Specifically:
- The deny-list is implemented using a regular expression that assumes schemes will appear strictly as
http://orhttps://(lowercase), and it is evaluated in a case-sensitive manner. - Go's
net/url.Parse()function, which is later used to establish the outbound connection, canonicalizes the scheme to lowercase as part of parsing. - Because deny-list enforcement is based on the un-normalized string while connection behavior is based on the normalized form, an attacker can choose a representation (for example,
HTTP://10.0.0.1) that slips through validation but still results in a valid HTTP request to an internal host.
In abstract terms, the code validates untrusted URLs using inconsistent assumptions about normalization and case-sensitivity, allowing crafted inputs to bypass network access controls and trigger SSRF.
Potential impact
- Access to internal network services that are not directly exposed to the internet.
- Queries to cloud instance metadata endpoints (for example,
HTTP://169.254.169.254/latest/meta-data/), which may reveal credentials, tokens, or configuration secrets. - Interaction with internal admin panels, databases, or orchestration endpoints reachable from the Gotenberg host.
- Use of Gotenberg as a pivot point to enumerate internal IP ranges and ports.
- Potential exfiltration of sensitive response data from internal services via Gotenberg's responses or logs, depending on how responses are surfaced.
General mitigation guidance
Effective mitigation focuses on strengthening URL validation and reducing trust in user-supplied endpoints rather than relying on string patterns alone.
Common defensive patterns include:
- Normalize before validation: Apply canonicalization (lowercasing schemes and hosts, resolving URL components) to user-supplied URLs before any security checks, and base deny-list or allow-list logic on the normalized representation.
- Deny by default: Prefer allow-lists of known-safe domains or outbound destinations over deny-lists of "unsafe" networks, especially for server-initiated HTTP requests.
- Network-layer egress controls: Use firewall rules, security groups, or service meshes to restrict the Gotenberg host or container from reaching private IP ranges, loopback interfaces, and metadata endpoints, independent of application logic.
- Limit dynamic callbacks: Where possible, avoid accepting arbitrary webhook URLs or remote download URLs from untrusted users; instead, constrain them to configured endpoints or internal routing mechanisms.
- Least privilege and isolation: Run Gotenberg in a tightly scoped environment with limited network reachability, and isolate it from sensitive administrative or metadata services.
How teams detect issues like this
To detect and monitor issues like this, consider:
- Static analysis and code review:
- Flag any code paths that:
- Construct outbound HTTP requests based on user-provided URLs.
- Apply deny-list or allow-list checks using simple string operations or case-sensitive regexes on schemes or hosts.
- Look for discrepancies between the representation of URLs during validation and how they are used in HTTP clients.
- Configuration and policy checks:
- Ensure security policies mandate URL normalization before validation.
- Require explicit documentation and review of any feature that performs callbacks or downloads based on user-supplied endpoints.
- Runtime monitoring:
- Log outbound requests made by Gotenberg, including destination host, IP, and scheme, and alert on connections to private address ranges or metadata endpoints.
- Use network-level monitoring or egress proxies to identify unexpected traffic from Gotenberg instances.
- Security testing:
- Include SSRF test cases in automated integration tests and security assessments, with particular focus on variations in URL casing, encoded characters, and unusual schemes.

