The vulnerability is a Server-Side Request Forgery (SSRF) in Gotenberg, identified as GHSA-5vh4-rgv7-p9g4. The root cause lies in the gotenberg.FilterDeadline function, which was used to validate user-supplied URLs across different modules. This function had an insecure default behavior: when the URL allow and deny lists were empty (the default configuration), it permitted any URL to pass through. This "fail-open" logic created multiple SSRF vectors.
The primary vector, as demonstrated in the proof-of-concept, is through the webhook feature. The webhook.webhookMiddleware function used FilterDeadline to validate the URL provided in the Gotenberg-Webhook-Url header. An attacker could abuse this to make Gotenberg send POST requests to arbitrary internal or external destinations.
However, the analysis of the patch that fixes this vulnerability reveals that the same flawed validation logic was used in other parts of the application, creating additional SSRF vectors:
- API Downloads: The
api.newContext function used FilterDeadline to validate URLs for the file download feature.
- Chromium URL Conversion: The
chromium.(*chromiumBrowser).do method used it to validate the main URL for PDF conversion.
- Chromium Asset Fetching: The
chromium.listenForEventRequestPaused function used it to validate URLs of sub-resources (like images or scripts) fetched during page rendering.
The fix, introduced in version 8.31.0, was comprehensive. It involved creating a new, secure validation function, gotenberg.FilterOutboundURL, which, in addition to regex-based filtering, resolves the URL's hostname and explicitly checks if the resulting IP address is a non-public one (e.g., RFC1918, loopback). All the identified vulnerable functions were updated to use this new secure function, and the underlying HTTP clients were hardened to use a new secureDialContext, effectively mitigating the SSRF risk across the application.