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

GHSA-G2XC-JV9Q-46WQ

WeKan and vikunja-file imports have no item-count cap, enabling in-process API OOM (unfixed variant of CVE-2026-91969)

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ón29 dDesde la divulgación, 22 oct 2026, 5:05 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
21 nov 26
22 oct 26
29 oct 26
6 nov 26
13 nov 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-G2XC-JV9Q-46WQ 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
Vikunja's WeKan file-import migrator decodes an uploaded JSON board with a plain `decoder.Decode(&board)` that applies no cardinality cap, materializes one `*models.TaskWithComments` struct per card in memory, and bulk-inserts every row with no batch cap. Any authenticated user can upload a ~22 MB WeKan JSON containing ~630,000 minimal cards and exhaust the API process memory (and trigger a multi-minute DB write storm), causing a full-instance denial of service. Duplicate IDs make it much worse: cards and checklist items are grouped by caller-supplied IDs, so many cards sharing one ID each replay every item, about cards × items (roughly 15 GB for 10k × 10k).

The vikunja-file (Vikunja export) importer has the same gap: its `data.json` (≤20MB) is decoded with no task-count cap.

This is the unfixed cardinality variant of CVE-2026-91969 (GHSA-pqf9-h8g4-8gmh). That advisory added `MigrationMaxCSVRows` to the CSV migrator, a `boundedSimpleDecoder` to TickTick, and `ValidateFile` to the vikunja-file migrator — but the WeKan `Migrator` implements neither a `FileValidator` nor any row/item limit. It is the only file-upload migrator lacking both.

## Root Cause
`pkg/modules/migration/wekan/wekan.go`:
- `parseWekanJSON` (:336-339): `json.NewDecoder(skipUTF8BOM(r)).Decode(&board)` — `Cards/Lists/ChecklistItems/Comments/Attachments` are unbounded slices, no `UseNumber`/limit.
- `convertWekanToVikunja` (:208-318): `for _, card := range board.Cards` materializes a `*TaskWithComments` per card plus map entries per checklist-item/comment/attachment. Secondary amplifier: per-card `task.Description += ...` concatenation over checklist items is O(n²) when many items share one card (:259-274).
- Duplicate-ID cross-product: checklist items are grouped by `ChecklistID` and checklists by `CardID` (:152-175), both caller-supplied. Every card sharing an ID replays all checklist items and comments of that ID (:258-274), and the description is built with `+=`. N cards × M items under one shared ID costs N × M rendered items.
- `migration.InsertFromStructure` → `models.CreateTasksForImport`: no batch cap.

`pkg/modules/migration/vikunja-file/vikunja.go`: `ValidateFile`/`scanArchive` bound the archive bytes, but `data.json` (≤20MB) is `json.Unmarshal`ed with no task-count cap (:467-473) and inserted through `InsertFromStructureWithFileProvider` (:490).

The WeKan `(*Migrator)` exposes only `Name()` and `Migrate()`, so `StartFileMigration`'s preflight `if v, ok := ms.(migration.FileValidator); ok` (`handler_file.go:67`) is skipped. The only size guard is the request `BodyLimit` (`pkg/routes/routes.go:208`, 22MB) — it caps bytes, never item count. CSV, TickTick and Planka are bounded.

## Impact
Memory exhaustion (OOM kill) and/or a multi-minute DB write storm → API process termination / unresponsiveness for the whole instance. The event bus is an in-process `gochannel.GoChannel` (`pkg/events/events.go`) with no external-worker backend, so `FileMigrationListener.Handle` runs in the API process — OOM during convert/insert kills the whole instance. The published CSV-migrator advisory (CVE-2026-91969) verified a 512 MiB process killed by a ~4 MB request; WeKan structs are heavier per item.

Proof of Concept

import json, requests
cards = [{"_id": f"c{i}", "title": "", "listId": "l"} for i in range(630_000)]
board = {"title": "x", "lists": [{"_id": "l", "title": "L"}], "cards": cards}
blob  = json.dumps(board).encode()  # ~22 MB
h = {"Authorization": "Bearer " + TOKEN}
r = requests.put(f"{B}/api/v1/migration/wekan/migrate", headers=h,
                 files={"import": ("wekan.json", blob, "application/json")})
print(r.status_code)  # 200 "Migration was started" — in-process import then OOMs the API

## Attack Chain
1. Entry: build ~22 MB JSON of minimal cards (`{"_id":"i","title":"","listId":"l"}` ≈ 35 B); 22MB/35B ≈ 630k cards fit under the body cap. Guard: `MaxBodyBytes` 22MB. Bypass proof: cardinality (item count), not byte size, is the uncapped amplification quantity — exactly the CSV-CVE amplification (~2M rows in ~4MB).
2. Upload: `PUT /api/v1/migration/wekan/migrate` (or v2 `POST`) multipart field `import`, JWT (any user). Guard: `StartFileMigration` FileValidator preflight (`handler_file.go:67`). Bypass proof: WeKan `Migrator` has only `Name` and `Migrate` → not a `FileValidator` → preflight skipped.
3. Process: in-process listener runs `Migrate` → `parseWekanJSON` (whole array into memory) → `convertWekanToVikunja` (0.6–1M structs + map entries held simultaneously) → `InsertFromStructure`→`CreateTasksForImport` (DB write storm). Guard: none. Bypass proof: no `MigrationMaxCSVRows`-equivalent anywhere in the WeKan parse/convert/insert path.
4. Impact: memory exhaustion / multi-minute DB storm → API process OOM/unresponsive for all tenants.

## Bypass Evidence
- `(*Migrator)` on v2.7.0 and HEAD exposes only `Name()` and `Migrate()` — no `MaxCSVRows`/`RowLimit`/`ValidateFile`/`FileValidator`; verified by grep of `wekan.go` (only `make(..., len(...))` capacity hints).
- CSV (`csv.go` `MigrationMaxCSVRows`=100000), and TickTick (`ticktick.go` `boundedSimpleDecoder`, comment cites `GHSA-pqf9-h8g4-8gmh`) have item caps. vikunja-file's `ValidateFile` only bounds archive bytes and `files/` entries, not the number of tasks in `data.json`.
- Routes always registered (no config flag): v1 `PUT /api/v1/migration/wekan/migrate`, v2 `POST /api/v2/migration/wekan/migrate`.

## Affected Versions
`<= 2.7.0` (present on the latest release tag v2.7.0 and on HEAD; no post-release fix). CVE-2026-91969's fix added caps only to CSV/TickTick/vikunja-file.

## Suggested Fix
- Add a total-item cap in `InsertFromStructureWithFileProvider` (vikunja-file uses it, `vikunja.go:490`), not only in `InsertFromStructure` (`create_from_structure.go:54`).
- Count-cap items during the WeKan and vikunja-file decode (e.g. a `FileValidator` pre-scan). `DecodeJSONLimited` is a byte cap and won't help: the payload is already under the byte limit.
- WeKan also needs duplicate-ID rejection (or a per-description byte cap) and a `strings.Builder` for the description, otherwise a small item count still multiplies into cards × items.

---
Reported by 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-g2xc-jv9q-46wq

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