/

CVE-2026-42596

Severity:

CRITICAL RISK

(9.4)

SSRF in Gotenberg downloadFrom and Webhook Features

CVE-2026-42596

Analyzed

Vulnerability type

Category:

Server-Side Request Forgery (SSRF)

CWE:

CWE-918

Impact:

Internal Network Access via SSRF

Severity:

CRITICAL RISK

(9.4)

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 HTTP fetch mechanisms for the downloadFrom and webhook features used a case-sensitive, regex-based deny-list that could be bypassed with specially crafted URLs.

An unauthenticated attacker can coerce a vulnerable Gotenberg instance into making HTTP requests to internal loopback or private services that should not be reachable from the outside.

Affected context

This vulnerability affects Gotenberg deployments that expose the downloadFrom feature or outbound webhooks over a network interface accessible to untrusted clients.

It is most relevant when:

  • Gotenberg can reach internal or private HTTP services (e.g., 127.0.0.1, RFC1918 ranges, service mesh endpoints).
  • Operators rely on the default deny-lists to block access to loopback or private addresses.
  • URL inputs for downloads or webhooks are supplied directly or indirectly by external users or automation.

The issue arises because the deny-list is both regex-based and case-sensitive, allowing alternative URL encodings and host representations to slip past the intended filters.

Exploit preconditions

  • Attack surface: The public API endpoints using downloadFrom and webhook URL handling.
  • Required access: Network access to the Gotenberg API; no authentication is required if the instance is exposed without additional access controls.
  • Input control: Ability to supply or influence the URL parameters used by downloadFrom or webhook callbacks.
  • Network layout: Gotenberg must be able to reach internal HTTP services (loopback, container-local, or private network addresses).
  • Why exploitation is possible: The deny-list relies on case-sensitive regular expressions and a limited set of patterns, allowing attackers to craft URLs (e.g., IPv6-mapped IPv4 like http://[::ffff:127.0.0.1]:... or case-variant schemes/hosts) that bypass the filters and direct requests toward internal-only targets.

Why this happens

The underlying issue is a fragile, pattern-based validation scheme for outbound URLs that trusts regex deny-lists to enforce network boundaries.

Instead of positively asserting what destinations are allowed, the implementation attempts to block "bad" addresses using case-sensitive regex filters against user-supplied URLs.

This approach is error-prone because:

  • IPs and hosts can be represented in multiple syntactic forms (e.g., IPv6, IPv6-mapped IPv4, mixed case, encoded characters).
  • Case sensitivity in the regex means variants not explicitly matched are treated as safe.

This corresponds to CWE-918: Server-Side Request Forgery (SSRF), where untrusted input controls server-initiated HTTP requests without robust restriction, allowing attackers to pivot into internal networks or privileged endpoints.

Potential impact

  • Coercing the server to send HTTP requests to loopback addresses (e.g., 127.0.0.1) and private network services.
  • Accessing internal-only HTTP endpoints such as admin panels, metadata services, or internal APIs that are not directly exposed to the internet.
  • Performing port scanning or service enumeration on internal networks via observable behavior (timing, error messages, response differences).
  • Triggering state-changing actions on internal services that rely solely on network segregation for protection.
  • Potentially exfiltrating sensitive data from internal HTTP endpoints, depending on response handling and logging.

General mitigation guidance

Effective mitigation focuses on constraining where server-initiated HTTP requests are allowed to go and reducing reliance on fragile pattern matching:

  • Prefer allow-lists over deny-lists: explicitly enumerate permitted hostnames, domains, or IP ranges that Gotenberg may contact.
  • Normalize and parse URLs using robust libraries, applying policy to structured fields (scheme, host, port, IP) rather than raw strings.
  • Deny loopback, link-local, and private address ranges by default at the network or application level, unless there is a well-justified use case.
  • Where feasible, route outbound HTTP requests through a controlled proxy or egress gateway that enforces destination policies.
  • Apply the principle of least privilege for network connectivity: locate Gotenberg in a network segment with minimal access to sensitive internal services.
  • Avoid exposing downloadFrom and webhook endpoints directly to untrusted clients when not strictly necessary; front them with gateways or middleware that can implement additional validation.

How teams detect issues like this

Detection typically combines code-level inspection with operational monitoring:

  • Static code analysis: Look for outbound HTTP client calls that use user-controlled URLs with deny-list style validation (regexes, substring checks) instead of structured parsing and allow-lists.
  • Code review signals: Any feature that "downloads from a URL" or "calls a webhook" should raise questions about how destinations are validated and whether internal ranges are blocked systematically.
  • Configuration and policy checks: Enforce organizational policies that require allow-lists and IP range checks for server-initiated HTTP calls; verify CI/CD pipelines flag deviations.
  • Runtime monitoring: Inspect logs or network telemetry for Gotenberg making requests to loopback (127.0.0.0/8, ::1) or private networks (e.g., 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16); unusual patterns can signal SSRF probing.
  • Security testing: Incorporate SSRF-focused tests in application security reviews, including attempts to reach internal-reserved addresses using alternate encodings and host representations.

Sources

SourceLink
github.comgithub.com/gotenberg/gotenberg/security/advisories/GHSA-4vmc-gm8v-m35h

Frequently asked

questions

Yes. If the vulnerable Gotenberg instance is reachable over the network and exposes the affected features, an external attacker can exploit the SSRF behavior remotely by supplying crafted URLs.

Not necessarily. The description indicates that the flaw can be triggered by an unauthenticated attacker, assuming the relevant endpoints are exposed without additional authentication layers.

Replace regex-based deny-lists with a robust allow-list policy based on parsed URL components and IP checks, and block all loopback and private address ranges by default unless there is a clear and controlled requirement to permit them.

Design features that initiate outbound HTTP requests with strict destination controls, use standard URL parsing and IP classification libraries, enforce allow-lists in both code and configuration, and include SSRF-specific checks in code review, automated testing, and security validation processes.

Find out what's already
exploitable in your codebase.