llamaCVEVulnerability Intelligence
/
Advisory · GitHub · Go · github.com/gotenberg/gotenberg/v8

GHSA-H9Q7-3G27-7RCH

Disk-backed multipart uploads persist after conversion requests

Parche disponible
Descargar PNG JSON
CVSS 3.1
7.5
Alta
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche2 versionesPrimer parche a -89 d de la divulgación
Exposición10 dDesde la divulgación, 11 nov 2026, 2:18 a. m.
Detección7 dDesde la divulgación hasta su ingreso al índice
Decisión estimadaSeguir
Remediar en la ventana regular de mantenimiento
Estimación de Llama con el árbol SSVC de CISA a partir de vector CVSS 3.1 y la evidencia de explotación (sin evaluación oficial): sin explotación conocida, automatizable e impacto técnico parcial. Hay versiones corregidas disponibles.
Esto amerita una regla de detección, por si acaso.No corre prisa, pero no la pierdas de vista.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Parche v8.36.0
Monitoreo
Detectada +1
14 ago 26
11 nov 26
18 nov 26
21 nov 26
14 ago 26
8 sept 26
3 oct 26
27 oct 26
21 nov 26
FechaFaseEventoDetalle
Remediación Parche v8.36.0 github.com/gotenberg/gotenberg/v8 · -89 d desde divulgación
Divulgación Publicada GHSA-H9Q7-3G27-7RCH divulgada · CVSS 7.5 (GitHub)
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

Summary

Gotenberg does not remove disk-backed temporary files created while parsing multipart requests. Uploaded files that exceed Go's in-memory multipart threshold are written to the process temporary directory as `multipart-*` and remain there after the request completes.

The files persist until the container or task is destroyed. Repeated requests can exhaust the temporary filesystem. More importantly, another conversion running as the same OS user can read documents left by earlier requests if it gains a local-file-read or code-execution primitive.

Affected versions

  • Confirmed affected: Gotenberg 8.29.0 through 8.34.0.
  • The current `main` branch was still affected at commit `9ec7be4` on 2026-08-11.
  • Gotenberg 8.28.0 does not contain the request-cloning behavior that causes this cleanup failure.

The behavior appears to have been introduced with the OpenTelemetry middleware in 8.29.0.

Technical details

The API registers `telemetryMiddleware` as a pre-router middleware for every request:

a.srv.Pre(
    latencyMiddleware(),
    rootPathMiddleware(a.rootPath),
    outputFilenameMiddleware(),
    telemetryMiddleware(...),
)

To attach the OpenTelemetry context, the middleware replaces Echo's request with a shallow clone:

request := c.Request()
savedCtx := request.Context()

// ...

c.SetRequest(c.Request().WithContext(ctx))

Multipart parsing happens later through the cloned request:

form, err := echoCtx.MultipartForm()

Go stores sufficiently large multipart file parts in `os.TempDir()` and records the resulting paths in the request's `MultipartForm`. At the end of an HTTP request, `net/http` invokes `RemoveAll()` only on the original server request's `MultipartForm`.

Because Gotenberg parses the body through the clone, the original request's `MultipartForm` remains nil. The standard-library cleanup therefore has nothing to remove. Restoring another clone to the Echo context after the handler returns does not update the original request object held by `net/http`.

Gotenberg copies each parsed upload into its UUID-based request working directory, so the parser-owned `multipart-*` file is no longer required once `newContext` returns. Existing cancellation cleanup removes only the UUID working directory, not the parser-owned temporary file.

Reproduction

The following uses a dummy upload. The conversion may fail because the dummy file is not a valid ODT; multipart parsing occurs before conversion and is sufficient to reproduce the leak.

docker run --rm --name gotenberg-multipart-repro -p 3000:3000 \
  gotenberg/gotenberg:8.34.0-libreoffice

dd if=/dev/zero of=/tmp/input.odt bs=1M count=40

curl -sS -o /dev/null -w '%{http_code}\n' \
  -F files=@/tmp/input.odt \
  http://127.0.0.1:3000/forms/libreoffice/convert

docker exec gotenberg-multipart-repro \
  sh -c 'find /tmp -maxdepth 1 -type f -name "multipart-*" -ls'
Expected result

No `multipart-*` file remains after the request finishes.

Actual result

`/tmp/multipart-*` contains the uploaded bytes and remains readable by the `gotenberg` user. Repeating the request creates additional persistent files.

Impact

  • Cross-request document remanence in deployments that reuse a worker for multiple users or tenants.
  • Disclosure of earlier uploads when combined with a converter local-file-read or code-execution primitive.
  • Temporary-filesystem exhaustion through repeated large multipart requests.
  • Retention lasts for the lifetime of the container or task rather than the lifetime of the request.

Suggested classification: CWE-459, Incomplete Cleanup.

Proposed fix

Explicitly call `multipart.Form.RemoveAll()` inside `newContext` after Gotenberg has finished copying uploaded files into its request working directory. This avoids relying on `net/http` cleanup through a request pointer that middleware has replaced.

The attached patch implements this cleanup and adds a regression test that forces an upload into a real disk-backed multipart file, invokes `newContext`, and verifies that the temporary file has been removed before conversion begins.

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:L
BajaAlta
PrivilegiosPR:N
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:N
AltoBajoNinguno
IntegridadI:N
AltoBajoNinguno
DisponibilidadA:H
AltoBajoNinguno
Score de explotaciónQué tan fácil y probable es que la exploten
10.0/ 10Muy alto
Vector 10.0 (muy fácil) · sin evidencia de explotación.
Versiones

Rangos afectados

Afectada Corregida Última
github.com/gotenberg/gotenberg/v8≥ 8.29.0 < 8.36.0
8.29.0
8.36.0
v8.40.0
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
gogithub.com/gotenberg/gotenberg/v8
Corregida v8.36.0 -89 d v8.40.0 no afectada
Versiones corregidas8.36.0v8.36.0
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/gotenberg/gotenberg/security/advisories/GHSA-h9q7-3g27-7rch

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.