Summary
Gotenberg, an API for converting document formats, contains a server-side request forgery (SSRF) issue where URL scheme validation can be bypassed by using mixed-case or uppercase schemes.
When user-controlled URLs are only validated in a case-sensitive manner, attackers may coerce the service into making unintended network requests to internal or otherwise restricted endpoints.
Affected context
This vulnerability occurs in Gotenberg deployments where the service accepts user-supplied URLs as input for document retrieval or conversion.
It specifically affects logic that attempts to restrict or filter URL schemes (e.g., allowing only http/https) but performs checks in a case-sensitive way.
Under these conditions, an attacker can craft URLs with mixed-case or uppercase schemes (e.g., HtTp:// or FILE://) to bypass the intended restrictions and cause the server to initiate unintended outbound requests.
Exploit preconditions
- Attack surface: Public or internal HTTP(S) endpoints that expose Gotenberg's document conversion API and accept user-controlled URLs.
- Required access: Ability to submit or influence input containing a URL (e.g., request parameters, JSON payloads, or form fields used by Gotenberg to fetch documents).
- Trigger point: URL handling and scheme validation logic that relies on case-sensitive comparisons to enforce allowed or disallowed schemes.
- Why exploitation is possible: The URL scheme comparison does not normalize case, allowing disallowed or sensitive schemes to be represented in mixed- or upper-case forms that bypass the existing filters.
Why this happens
The root cause lies in insufficient input normalization and validation of URL schemes before they are used by the server to initiate outbound network requests.
The prior fix for a related issue enforced scheme restrictions but implicitly assumed a consistent lowercase representation, leading to a case-sensitivity bypass.
This maps to CWE-918 (Server-Side Request Forgery), where an application can be tricked into making arbitrary network requests, and CWE-22 (Improper Limitation of a Pathname to a Restricted Directory) when non-HTTP schemes like file or similar handlers could be abused to access unintended local or internal resources.
Conceptually, the insecure pattern is: accepting user-controlled URLs, applying incomplete or case-sensitive scheme checks, and then using those URLs as-is in privileged server-side network calls.
Potential impact
- The service may perform HTTP(S) requests to internal network resources not directly accessible from the outside (intranet sites, internal APIs, cloud metadata endpoints).
- Internal services that trust traffic originating from Gotenberg's host or network segment can be probed or interacted with by an attacker.
- Sensitive information exposed by internal endpoints (configuration data, credentials, metadata) may be exfiltrated via the server's response.
- Depending on the environment, attackers could pivot deeper into the infrastructure, chaining SSRF with other weaknesses (e.g., misconfigured metadata services).
- If non-web schemes are mishandled, the process may gain access to unintended local or file-like resources.
General mitigation guidance
Effective mitigation centers on robust URL validation, normalization, and strict control of where the server is allowed to connect.
Recommended defensive patterns include:
- Normalize URL schemes (e.g., converting to lowercase) before any validation, and apply allowlist-based checks on acceptable schemes (such as
httpandhttpsonly). - Enforce strict host and network allowlists, ensuring the service only connects to known-safe destinations (e.g., specific domains or IP ranges) rather than arbitrary user-provided hosts.
- Deny access to private or sensitive IP ranges (loopback, link-local, RFC1918, and cloud provider metadata IPs) even if the scheme appears valid.
- Treat user-provided URLs as untrusted input: perform parsing using hardened libraries, reject malformed or ambiguous URLs, and avoid automatic following of redirects to unknown hosts.
- Apply defense-in-depth at the infrastructure level, such as outbound firewall rules or egress policies that constrain where Gotenberg instances can connect.
How teams detect issues like this
Detection approaches can combine code-level analysis with runtime monitoring:
- Static analysis and code review: Search for URL handling paths where:
- User-provided URLs are passed to HTTP clients or file access APIs.
- Scheme checks rely on direct string comparisons without prior normalization.
- No explicit host or network allowlists are in place.
- Policy enforcement: Implement coding guidelines or lint rules that require:
- Lowercasing of URL schemes prior to comparison.
- Use of central, audited helper functions for URL validation and outbound requests.
- Runtime monitoring:
- Log and audit outbound requests from Gotenberg, focusing on unusual destinations (internal IP ranges, metadata services, or unexpected domains).
- Use network-level monitoring or egress filtering to detect and block suspicious SSRF-like patterns.
- Automated security scanning tools, including SAST and DAST, can be configured to look for SSRF patterns and to fuzz URL inputs with variant casing to validate that protections are effective.

