llamaCVEVulnerability Intelligence
/
Advisory · GitHub · Go · code.vikunja.io/api

GHSA-WQJR-22R7-5437

Trello, Todoist and Microsoft To Do migrations buffer remote downloads and API responses without limits, enabling in-process API OOM

Sin parche publicado
Descargar PNG JSON
CVSS 3.1
6.5
Media
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición28 dDesde la divulgación, 22 oct 2026, 5:07 a. m.
Detección27 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
22 oct 26
18 nov 26
19 nov 26
22 oct 26
29 oct 26
5 nov 26
12 nov 26
19 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-WQJR-22R7-5437 divulgada · CVSS 6.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

The Trello and Todoist migration importers download board backgrounds, card attachments, card covers, and note attachments into unbounded in-memory `bytes.Buffer`s and retain every blob on the in-memory `ProjectWithTasksAndBuckets` hierarchy until the entire account is converted. The underlying HTTP client (`NewSSRFSafeHTTPClient`) caps only the per-request *duration* (30s), not the response *size*, so any authenticated user who initiates a migration whose remote JSON references a huge attacker-served attachment can drive the shared API process into OOM. The same users can also OOM it with huge API responses: the Todoist and Microsoft To Do migrators decode success responses with no size cap, and the Todoist cursor loops have no aggregate item cap. This is the direct, unfixed sibling of the Planka importer OOM fixed as GHSA-wq92-8x3r-fm38 — the Planka fix added a `DownloadFileWithHeadersLimited` + per-import byte budget, but those were never ported to the Trello and Todoist code paths.

Root Cause

`pkg/modules/migration/helpers.go:63` reads the full response body with no size limit:

_, err = buf.ReadFrom(resp.Body)

Both `DownloadFile` (helpers.go:51) and `DownloadFileWithHeaders` (helpers.go:56) call this unbounded path. The hardened sibling `DownloadFileWithHeadersLimited` (helpers.go:69) uses `io.LimitReader(resp.Body, maxBytes+1)` and is called only from the Planka importer (`pkg/modules/migration/planka/client.go:624`).

Trello calls bare `DownloadFile`/`DownloadFileWithHeaders`:
- `pkg/modules/migration/trello/trello.go:259` — board background
- `pkg/modules/migration/trello/trello.go:341` — card attachment (sends the OAuth token in headers)
- `pkg/modules/migration/trello/trello.go:377` — card cover

Todoist calls bare `DownloadFile`:
- `pkg/modules/migration/todoist/todoist.go:522` — note attachment

Each downloaded blob is retained as `FileContent: buf.Bytes()` on the in-memory structure (trello.go:353, :388; todoist.go:538) for the entire conversion. The configured `files.maxsize` limit is only enforced downstream in `InsertFromStructure` (trello.go:518, todoist.go:808) — *after* every attachment has already been resident in RAM.

The HTTP client (`NewSSRFSafeHTTPClient`, `pkg/httpclient/httpclient.go:50` → `newHTTPClient:59`) sets only `Timeout` (default 30s) and no response-size cap.

API responses are unbounded on the success path too (the 4xx paths in `DoGetWithClient`/`DoPostWithHeaders` are already capped, `helpers.go:137,181`):
- Todoist: `json.NewDecoder(resp.Body).Decode` at `todoist.go:600,649,673,716,754,783`.
- Microsoft To Do: token decode at `microsoft_todo.go:182`; `makeAuthenticatedGetRequest` reads the whole body of a raw `client.Do` with `buf.ReadFrom` (:200) and then `json.Unmarshal`s it (:216).
- The Todoist cursor loops (`todoist.go:661-729`, `:742-765`) accumulate every page with no aggregate item cap.

Planka is bounded.

Impact

Memory-exhaustion DoS of the shared Vikunja API process. Migration runs on the in-process watermill `gochannel` pub/sub (`pkg/events/events.go:92`), so an OOM kill terminates the whole API for all tenants, not an isolated worker. A single oversized stream and/or many simultaneously-retained attachments drive RSS up until the kernel OOM-killer or the configured limit terminates the process.

Proof of Concept

Precondition: on an instance where `migration.trello.enable=true` (or `migration.todoist.enable=true`) and the admin has registered the OAuth app key — i.e. the standard import feature is enabled.

  1. Attacker (any authenticated Vikunja user) prepares a Trello board under their own Trello account containing a single card attachment pointing at a large attacker-controlled URL, e.g. `https://attacker.example/huge` which streams multi-GB of random bytes.
  2. Attacker authorizes Vikunja against their own Trello account via the normal OAuth flow and POSTs `/api/v2/migration/trello/migrate` (JWT-authenticated).
  3. Vikunja fetches the board JSON, then for each attachment calls `migration.DownloadFileWithHeaders(attachment.URL, …)` (trello.go:339) → `getFile` → `buf.ReadFrom(resp.Body)`.
  4. `attacker.example` is a public host, so the SSRF client allows the request; the client has no byte cap; `buf.ReadFrom` streams the whole body into memory.
  5. API process RSS climbs until OOM kill → full outage.

Attack Chain

  1. Entry. POST `/api/v2/migration/trello/migrate` (or `/todoist/migrate`), authenticated.
  2. Guard. JWT auth; `migration.{trello,todoist}.enable=true` (default false) + admin-registered OAuth app key.
  3. Bypass proof. The feature flag is an admin decision to enable a normal product feature. Once enabled, any authenticated user may migrate their own account. This is the identical precondition as the published Planka advisory (GHSA-wq92-8x3r-fm38, HIGH).
  1. Attacker-controlled URL. The remote Trello/Todoist account references `https://attacker.example/huge`.
  2. Guard. Todoist's `isDownloadableURL` (todoist.go:325) checks only `scheme ∈ {http, https}` and non-empty host. Trello has no URL filter at all.
  3. Bypass proof. Read of the function — no size cap, no host allowlist. Attacker-controlled URL passes trivially.
  1. Fetch via SSRF-safe client.
  2. Guard. `NewSSRFSafeHTTPClient` blocks non-globally-routable IPs; sets `Timeout: 30s`.
  3. Bypass proof. `attacker.example` is a public host; SSRF guard is irrelevant. `httpclient.go:59-68` sets no `MaxBytesReader`/`LimitReader`. At 100 Mbit/s, 30s = ~375 MB in one buffer; on faster links multi-GB.
  1. Sink: unbounded buffer read. `buf.ReadFrom(resp.Body)` at `pkg/modules/migration/helpers.go:63`.
  2. Guard. Should be `DownloadFileWithHeadersLimited` + per-import `budget` as Planka has.
  3. Bypass proof. `grep -n "Limited\|budget\|LimitReader" pkg/modules/migration/trello/trello.go pkg/modules/migration/todoist/todoist.go` returns empty. `files.maxsize` is enforced only inside `InsertFromStructure`, downstream of every download — cannot interrupt the download-phase OOM.
  1. Impact. Blobs retained as `FileContent: buf.Bytes()` across the in-memory hierarchy; API process OOM-kills under in-process gochannel execution → outage for all tenants.

Bypass Evidence

  • `pkg/modules/migration/helpers.go:63`:
  • `pkg/modules/migration/helpers.go:81` (hardened sibling, not called from Trello/Todoist):
  • `grep -rn "DownloadFileWithHeadersLimited\|budget" pkg/modules/migration/{trello,todoist}/` → no matches.
  • `git log v2.7.0..HEAD -- pkg/modules/migration/` → no fix post-release.
  • GHSA-wq92-8x3r-fm38 description references only `pkg/modules/migration/planka/*`; the fix was Planka-scoped, Trello/Todoist code paths are untouched.

Affected Versions

  • Package: `code.vikunja.io/api` (ecosystem: `go`)
  • Vulnerable: `<= 2.7.0` (HEAD at commit `6263ff1`, `v2.7.0-7-g6263ff1`)
  • No fix released or on `main` for Trello/Todoist as of this report.

Suggested Fix

Mirror the Planka hardening to Trello, Todoist and Microsoft To Do:
1. Replace each `migration.DownloadFile(url)` / `DownloadFileWithHeaders(url, headers)` call in `trello.go` and `todoist.go` with `migration.DownloadFileWithHeadersLimited(hc, url, headers, maxBytes)` (`helpers.go:69`) where `maxBytes` is `files.maxsize` (or a lower per-attachment cap). The Trello card-attachment download (`trello.go:341`) sends the OAuth token, so it needs a redirect-refusing client (see `helpers.go:68`); Go replays the headers across hosts otherwise.
2. Decode every success-path API response with `DecodeJSONLimited` (`helpers.go:204`), including Microsoft To Do's `makeAuthenticatedGetRequest`.
3. Add an aggregate item cap across the Todoist cursor loops.
4. Introduce a per-import byte budget on `trelloMigration`/`todoistMigration` structs (analogous to Planka's `budget` on `client.go:612-634`) and decrement it on each download; abort the migration with a clear error when exceeded, before buffering further blobs.
5. Optionally stream directly into the files store instead of buffering `FileContent` into memory.

Credit

zx (Jace) — GitHub: @manus-use

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:N
AltoBajoNinguno
IntegridadI:N
AltoBajoNinguno
DisponibilidadA:H
AltoBajoNinguno
Versiones

Rangos afectados

Afectada Corregida Última
code.vikunja.io/api≤ 2.7.0
v0.24.6
2.7.0
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
gocode.vikunja.io/api
Sin parche — — v0.24.6 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/go-vikunja/vikunja/security/advisories/GHSA-wqjr-22r7-5437

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