Skip to content

fix(security): harden authorization and resource limits - #3688

Merged
kolaente merged 22 commits into
mainfrom
fix-draft-security-advisories
Aug 31, 2026
Merged

fix(security): harden authorization and resource limits#3688
kolaente merged 22 commits into
mainfrom
fix-draft-security-advisories

Conversation

@tink-bot

Copy link
Copy Markdown
Collaborator

Hardens shared authorization, parsing, media, rate-limit, and migration boundaries covered by the pending security advisory batch.

References: GHSA-xxc3-xpmc-vmvr, GHSA-pqf9-h8g4-8gmh, GHSA-wq92-8x3r-fm38, GHSA-4vh2-39rq-rq8j, GHSA-w7jp-mf2v-8342, GHSA-m469-88xx-8rx2, GHSA-8wvg-r2j4-3737, GHSA-w2ch-4xgr-22ww, GHSA-g38j-7v97-x298, GHSA-3hc7-r24j-rpwc, GHSA-jp29-jrxc-92vf, GHSA-39p5-2wrr-xh29, GHSA-vfxw-3x8p-2vjr, GHSA-88f6-4rjv-x774, GHSA-9rg3-v78m-26q8, GHSA-w39f-h553-h2mx, GHSA-qfwc-vx6f-3g6g.

How to verify

  1. Configure low CSV and Vikunja-file import limits, then run an import at the limit, one above it, and two simultaneous imports for the same user.

  2. Expected: The bounded import succeeds, oversized imports return a 4xx resource-limit error, overlapping imports return 412, and a failed import can be retried.

  3. Create two users with access to different projects and teams, then exercise task relations, subtasks, favorites, positions, team attachment, user listings, and link-share reads across that boundary.

  4. Expected: Authorized operations still work, while inaccessible tasks, users, team details, and link-share hashes are neither returned nor modified.

  5. Enable TOTP, query its status and QR endpoint, submit repeated invalid BasicAuth requests, and upload both normal and oversized images.

  6. Expected: Enabled TOTP secrets stay hidden, its QR endpoint is denied, failed BasicAuth attempts are limited without limiting successful requests, normal images work, and hostile dimensions return 400.

Existing tasks-only tokens that used expand=comments, expand=reactions or
expand=time_entries_count will start receiving 401; they need to add the
tasks_comments, reactions or time_entries read_all scope respectively.
Also fixes IsErrInvalidFilterExpression to use errors.As: the parse paths
return pointer errors while the checker asserted a value type, so an
unparsable saved filter hard-failed its view instead of being skipped.
Decoding now validates image dimensions before allocating pixels
(imaging.Fit replaces unbounded Resize so neither side can blow up),
backgrounds decode once and reuse the image for the blur hash, and
DownloadImage is bounded at the configured max file size. Small sources
now keep their native size (Fit does not upscale); the frontend scales
via CSS.
Per-job budget: 128 MiB aggregate response bytes (counted while
decoding, not from Content-Length), 64 MiB retained attachments,
50,000 decoded entities and 2,000 outbound request attempts counted
at the transport level so retries cannot multiply work. The
per-response cap drops to 4 MiB. Budget exhaustion aborts the import
with a typed error; ordinary 404/timeout attachment failures keep the
log-and-skip.
Preflight over the declared uncompressed sizes (overflow-safe), a file
count cap and a per-user storage quota bound the import before
anything is read; the actual decompressed bytes are still counted
against the same budget while reading. Attachments and backgrounds
now stream through a lazy provider: one zip entry is decompressed
into a private temp file at a time. A failed import deletes the file
blobs it wrote, which were orphaned for every migrator before.
@tink-bot
tink-bot temporarily deployed to preview-trusted August 31, 2026 15:44 — with GitHub Actions Inactive
@github-actions github-actions Bot added area/auth Login, OIDC, LDAP, SAML, TOTP/2FA, PKCE, SCIM, sessions, password area/avatars User avatar providers (Gravatar, LDAP, upload) and rendering area/import-export Importers (WeKan, Todoist, …) and data exports area/permissions Sharing, link sharing, roles, access control, assignee roles labels Aug 31, 2026
@kolaente
kolaente enabled auto-merge (rebase) August 31, 2026 15:44
@github-actions github-actions Bot added the auto-merge PR has GitHub auto-merge enabled label Aug 31, 2026
@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown

Preview Deployment

Preview deployments for this PR are available at:

URL Tag Commit
https://pr-3688.preview.vikunja.dev ghcr.io/go-vikunja/vikunja:pr-3688 latest
https://sha-d55cfbc586ab93ed03565e88ee790328b8cdb6c4.preview.vikunja.dev ghcr.io/go-vikunja/vikunja:sha-d55cfbc586ab93ed03565e88ee790328b8cdb6c4 d55cfbc
https://sha-1ec8a75e8fb7122fe72fce2f910ad246e86442a4.preview.vikunja.dev ghcr.io/go-vikunja/vikunja:sha-1ec8a75e8fb7122fe72fce2f910ad246e86442a4 1ec8a75
https://sha-4e67e843ab70ff15abf45dff883fd8ff13eece99.preview.vikunja.dev ghcr.io/go-vikunja/vikunja:sha-4e67e843ab70ff15abf45dff883fd8ff13eece99 4e67e84
https://sha-19f7b51b91b36ec569634597a76e4c2980d9d45b.preview.vikunja.dev ghcr.io/go-vikunja/vikunja:sha-19f7b51b91b36ec569634597a76e4c2980d9d45b 19f7b51

The preview environment will start automatically on first visit. Subsequent pushes to this PR will update the pr-3688 image — the preview picks up the new version on restart. The per-commit URLs point to a specific version and will not change.

Run locally with Docker
docker pull ghcr.io/go-vikunja/vikunja:pr-3688
docker run -p 3456:3456 ghcr.io/go-vikunja/vikunja:pr-3688

Last updated for commit d55cfbc

@tink-bot
tink-bot temporarily deployed to preview-trusted August 31, 2026 15:59 — with GitHub Actions Inactive
@tink-bot
tink-bot temporarily deployed to preview-trusted August 31, 2026 16:11 — with GitHub Actions Inactive
@kolaente
kolaente merged commit 077dc4d into main Aug 31, 2026
42 checks passed
@kolaente
kolaente deleted the fix-draft-security-advisories branch August 31, 2026 16:37
@github-actions github-actions Bot removed the auto-merge PR has GitHub auto-merge enabled label Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/auth Login, OIDC, LDAP, SAML, TOTP/2FA, PKCE, SCIM, sessions, password area/avatars User avatar providers (Gravatar, LDAP, upload) and rendering area/import-export Importers (WeKan, Todoist, …) and data exports area/permissions Sharing, link sharing, roles, access control, assignee roles

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants