The vulnerability is a Server-Side Request Forgery (SSRF) bypass in Gotenberg version 8.30.1 and earlier. The root cause is the use of a case-sensitive regular expression to validate URLs against a deny-list. An attacker can bypass this check by using uppercase characters in the URL scheme (e.g., HTTP:// instead of http://). The underlying Go HTTP client normalizes the URL scheme to lowercase before making the request, thus allowing the request to internal services that are supposed to be blocked.
The patch, identified in commit 924576d3d4c5f05b3aabcb9365cb50a646d9eaf6, addresses this by introducing a new function, FilterOutboundURL, which normalizes the URL scheme to lowercase before performing any validation. The patch replaces all calls to the previously used vulnerable function, FilterDeadline, with the new, secure function.
The analysis of the patch identified four key functions that were calling the vulnerable FilterDeadline function and are therefore the entry points for this SSRF vulnerability:
newContext in pkg/modules/api/context.go for handling downloadFrom URLs.
webhookMiddleware in pkg/modules/webhook/middleware.go for handling webhook URLs.
chromiumBrowser.do in pkg/modules/chromium/browser.go for handling the main URL for conversion.
listenForEventRequestPaused in pkg/modules/chromium/events.go for handling sub-requests within a page.
An attacker exploiting this vulnerability could make the server access internal network services, potentially leading to information disclosure or further attacks on the internal network.