0 Day Bug Breaks Multi Million Dollar System
The Gotenberg PDF conversion service was exposed without authentication and had multiple vulnerabilities: path traversal in file upload, arbitrary file read via template helper, and a race condition in temporary profile handling that allowed code execution. An attacker could chain these to achieve unauthenticated remote code execution inside the organisation's network.
Published on infosecwriteups.com
The other day we got an order for black-box pentests from a country-wide organization. The organization serves tens or even hundreds of services across the country and their users are counted in millions.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the Gotenberg service was exposed without authentication and its file handling and temporary profile management lacked proper input validation and isolation, allowing path traversal, arbitrary file read, and race-condition-based code execution.
Impact
An unauthenticated attacker could execute arbitrary code inside the organisation's network, pivot to internal services, and remain undetected for about two weeks.
What the attacker needed
Gotenberg exposed to the internet; no authentication required
The fix
The vulnerabilities were fixed in Gotenberg version 6.3.0, and the authors stated that Gotenberg should only be used internally by trusted applications.
How it was found
- Discover the Gotenberg component exposed at /api/gotenberg.
- Exploit path traversal in file upload to write arbitrary files.
- Use the toHTML helper to read arbitrary files from the container.
- Upload a malicious LibreOffice configuration to set up a macro.
- Flood the server with requests to reuse a predictable temporary profile directory.
- Trigger macro execution to achieve code execution.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
This is about a service that turns HTML or documents into PDF files. It was reachable from the internet without a password and had several flaws: you could upload files to any location, read any file on the server, and eventually run your own commands. The attacker combined these to take control of the server.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.