/

CVE-2026-40280

Severity:

HIGH RISK

(7.5)

SSRF in Gotenberg Webhook & Download Deny-Lists

CVE-2026-40280

Analyzed

Vulnerability type

Category:

Server-Side Request Forgery (SSRF)

CWE:

CWE-918

Impact:

Internal Network Access / SSRF

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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-list and/or --api-download-from-deny-list protections 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:// or https:// (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.

Sources

SourceLink
github.comgithub.com/advisories/GHSA-jjwv-57xh-xr6r
github.comgithub.com/gotenberg/gotenberg/commit/3f01ca18d3cc21375a1e2da4b5a3f261c8548e47
github.comgithub.com/gotenberg/gotenberg/security/advisories/GHSA-5q7p-7jgv-ww56

Frequently asked

questions

Yes. If the Gotenberg API is exposed to untrusted networks, an attacker can remotely submit crafted URLs that exploit the case-sensitivity flaw to trigger SSRF without needing local access.

The attacker needs the ability to send requests to Gotenberg endpoints that accept user-controlled URLs for webhooks or remote downloads. No additional authentication is required where those endpoints are open.

Normalize URLs before enforcement and base all deny-list or allow-list decisions on the parsed representation (scheme, host, IP, and port). Combine that with network-layer egress controls that restrict which destinations the service can reach, reducing reliance on application-level regex checks.

Standardize URL handling: always use a single parsing routine, canonicalize values before validation, and prefer allow-lists over deny-lists for outbound requests. Incorporate SSRF-focused code review checklists, static analysis rules targeting user-controlled HTTP destinations, and regular security testing that exercises edge cases like mixed-case schemes, encoded hosts, and redirects.

Find out what's already
exploitable in your codebase.