llamaCVEVulnerability Intelligence
/
Advisory · GitHub · npm · ep_etherpad-lite

GHSA-X4MJ-5635-3FQ9

Etherpad: SSRF via image-src filter bypass in DOCX/PDF/ODT export pipeline

Sin parche publicado
Descargar PNG JSON
CVSS 3.1
4.3
Media
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición23 dDesde la divulgación, 27 oct 2026, 8:03 a. m.
Detección22 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Monitoreo
Detectada +1
27 oct 26
18 nov 26
20 nov 26
27 oct 26
2 nov 26
8 nov 26
14 nov 26
20 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-X4MJ-5635-3FQ9 divulgada · CVSS 4.3 (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
`stripRemoteImages()` was added specifically to stop export from becoming a "blind SSRF sink" when a plugin/hook injects an `<img src="http://...">` into the exported HTML (the code's own comment states this threat model explicitly). The gate `isLocalSrc(src)` that decides whether an `<img>` survives has an anchoring bug that lets a trivially-crafted URL slip through as "safe."

### Details
`isLocalSrc()` (`src/node/utils/ExportSanitizeHtml.ts`, lines ~160-166) returns `true` ("safe, keep it") unless the src starts with `//` or matches the anchored regex `/^[a-z][a-z0-9+.-]*:/i` for a URI scheme. Because the scheme check is anchored to the very start of the string with no trimming/normalization first, prefixing the URL with a single leading space, tab, or newline (`" http://..."`) makes the anchor fail, so `isLocalSrc` misclassifies an absolute remote URL as "local" and the `<img>` tag passes through unmodified into the document handed to the converter (called from `src/node/handler/ExportHandler.ts`, both the native docx/pdf branch and the legacy LibreOffice/soffice branch).

This is exploitable in both actual export backends:
1. The native DOCX path uses `html-to-docx@1.8.0`, whose image handling delegates to `image-to-base64@2.2.0`. That library's own URL check, `/http(s)?:\/\/.../gi.test(url)`, is UNANCHORED, so it still detects the embedded `http://` and calls `fetch(urlOrImage)` on the whole (whitespace-prefixed) string; Node's WHATWG URL parser trims leading C0/space per spec, so the request is issued to the real target — full SSRF from the Etherpad server's network position (e.g. cloud metadata endpoints, internal admin services), with the HTTP response bytes embedded into the resulting `.docx` as an "image" part.
2. The same bypassed `<img>` tag is also written into the temp HTML file for the legacy LibreOffice/soffice conversion path, which the code's own comment says fetches remote image URLs during conversion — so the SSRF also affects ODT/DOC/PDF export on any deployment that has `soffice` configured (a common production configuration).

### PoC
Verified directly: `isLocalSrc(" http://169.254.169.254/latest/meta-data/iam/security-credentials/foo")` returns `true` (not stripped), `image-to-base64`'s own validity regex also returns `true` for that string, and `new URL(...)` on it resolves cleanly to `http://169.254.169.254/...`.

Built and ran a full end-to-end reproduction with real, unmodified pinned dependencies: fed the malicious `<img src=" http://...">` through the actual `htmlparser2`-based `stripRemoteImages()` — the attribute value is not trimmed, so the tag survives byte-for-byte. Installed the real pinned `html-to-docx@1.8.0` (which vendors an identical copy of `image-to-base64@2.2.0`'s unanchored regex and `node-fetch` call) and fed it the actual `stripRemoteImages()` output exactly as `ExportHandler.ts` does. Started a local HTTP listener and confirmed via server logs that genuine outbound GET requests were issued for leading-space/tab/newline payloads and a simulated `.../iam/security-credentials/fake-role` path — real SSRF, not theoretical.

Precondition: any installed plugin that embeds a collaborator-influenced URL into an `<img src="...">` via one of Etherpad's documented export hooks (`exportHTMLAdditionalContent`, `getLineHTMLForExport`, or similar) — exactly the class of hook the `stripRemoteImages` comment says it exists to defend against. A pad collaborator sets that image URL to ` http://169.254.169.254/latest/meta-data/iam/security-credentials/<role>` (note the leading space) via the plugin's normal UI/attribute mechanism. When any user (or an automated export job) exports the pad as `.docx` (native path, the default when `soffice` isn't configured) or as `.odt`/`.doc`/`.pdf` (legacy soffice path), the server-side export process fetches the metadata/internal URL.

### Impact
A pad collaborator (edit access only) can turn the export feature into an SSRF primitive against the Etherpad server's own network position, confirmed as a real outbound request via live HTTP listener testing — not merely a theoretical filter gap. This bypasses an intentionally-built, previously-hardened security control (`stripRemoteImages`), not a scope-disqualifying precondition.

Suggested fix: normalize/trim the `src` string (strip leading/trailing whitespace and control characters) before applying the anchored scheme-check regex in `isLocalSrc()`, matching how a real URL parser would canonicalize the string before use.

For credit/changelog purposes, please use: Yazan Balawneh, Cystack.ps

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

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:L
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:L
AltoBajoNinguno
IntegridadI:N
AltoBajoNinguno
DisponibilidadA:N
AltoBajoNinguno
Versiones

Rangos afectados

Afectada Corregida Última
ep_etherpad-lite≤ 3.3.5
1.8.14
3.3.5
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
npmep_etherpad-lite
Sin parche — — 1.8.14 afectada
Explotación

Arsenal público

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

Referencias
Advisoryhttps://github.com/ether/etherpad/security/advisories/GHSA-x4mj-5635-3fq9

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