Summary
Gotenberg's LibreOffice conversion endpoint can be abused with specially crafted documents that cause LibreOffice to fetch external HTTP(S) resources and reference local files during conversion.
When untrusted users can submit documents to this endpoint, this behavior enables blind SSRF against internal services and limited local file disclosure through linked image resource loading.
Affected context
This vulnerability appears in deployments that expose the /forms/libreoffice/convert endpoint to process user-supplied documents for PDF generation.
It is relevant when:
- LibreOffice is used as the document conversion engine behind the API
- Documents with embedded or linked resources are accepted from untrusted or semi-trusted sources
- The Gotenberg container or host has network access to internal services or sensitive file locations
Exploit preconditions
- Attack surface: The
/forms/libreoffice/convertHTTP endpoint accepting document uploads - Required access: Ability to submit or upload arbitrary documents to the conversion API
- Trigger point: Document conversion process when LibreOffice resolves embedded or linked resources
- Why exploitation is possible: LibreOffice follows external and local resource links in documents without enforcing strict isolation or filtering, allowing abuse as a proxy to internal networks and file paths
Why this happens
The core issue is that the document conversion pipeline implicitly trusts resource references within uploaded documents.
LibreOffice, when instructed by document metadata, automatically attempts to retrieve external URLs and local file paths, effectively turning the conversion service into a request initiator on behalf of the attacker.
This aligns with CWE-918: Server-Side Request Forgery (SSRF), where a server-side component makes network or file system requests based on unvalidated, attacker-controlled input.
Potential impact
- Blind SSRF to internal HTTP(S) services reachable from the Gotenberg environment
- Limited disclosure of local file contents via linked images or resources
- Mapping of internal network endpoints based on response timing or conversion behavior
- Potential pivot towards further attacks if internal services respond differently to crafted requests
General mitigation guidance
Mitigation typically focuses on constraining how document conversion engines handle external and local resources and tightening trust boundaries around uploaded content.
Useful patterns include:
- Disabling or restricting automatic retrieval of external URLs and local file paths during document conversion
- Running conversion workers in highly isolated sandboxes with minimal network access and restricted file system visibility
- Implementing pre-processing or validation that strips or normalizes embedded resource references in uploaded documents
- Applying least-privilege principles to containers and services so that internal networks and sensitive directories are not reachable from the conversion process
How teams detect issues like this
Detection often relies on a mix of configuration review and behavioral monitoring.
Possible strategies include:
- Static analysis or configuration checks to ensure conversion engines are not allowed to follow external or local resource links from untrusted documents
- Code and infrastructure review focusing on endpoints that proxy requests to internal services or file systems based on user-supplied metadata
- Network monitoring and logging around conversion containers to detect unusual outbound HTTP(S) requests correlated with document uploads
- Policy enforcement in CI/CD that flags introduction of document processing paths which do not sanitize embedded resource references

