Summary
Vikunja: Plaintext storage of password-reset/email-confirm tokens in database enables account takeover on DB read access
Advisory details
Summary
Vikunja stores password-reset, email-confirmation, and account-deletion tokens in the user_tokens table in plaintext. If an attacker gains read access to the database through a backup leak, misconfigured storage, or SQL-level exposure, they can immediately use pending tokens to take over user accounts without knowing passwords.
Details
pkg/user/token.go — genToken() stores the raw random string directly:
func genToken(u *User, kind TokenKind) (*Token, error) {
tokenStr, err := utils.CryptoRandomString(tokenSize)
...
return &Token{
UserID: u.ID,
Kind: kind,
Token: tokenStr, // stored as-is, no hashing
}, nil
}
Lookup also uses plaintext equality:
func getToken(s *xorm.Session, token string, kind TokenKind) (t *Token, err error) {
has, err := s.Where("kind = ? AND token = ?", kind, token).Get(t)
}
Affected token types:
TokenPasswordReset(pkg/user/user_password_reset.go:120)TokenEmailConfirm(pkg/user/user_create.go:101,pkg/user/update_email.go:88)TokenAccountDeletion(pkg/user/delete.go:102)
Note: CalDAV tokens correctly use generateHashedToken with bcrypt — the same protection is absent for the above types.
PoC
-- Attacker with DB read dumps all pending password-reset tokens:
SELECT u.email, t.token FROM user_tokens t
JOIN users u ON u.id = t.user_id WHERE t.kind = 1;
-- Then takes over any account:
curl -X POST https://vikunja.example.com/api/v1/user/password/reset \
-H 'Content-Type: application/json' \
-d '{"token": "<plaintext_from_db>", "new_password": "AttackerPass1!"}'
Impact
Any read access to the database (leaked backup, cloud misconfiguration, secondary SQLi) allows an attacker to take over every user account with a pending reset token within the 24-hour token lifetime. Full account takeover including admin accounts.
Fix
Replace genToken with generateHashedToken for TokenPasswordReset, TokenEmailConfirm, and TokenAccountDeletion. Update the corresponding lookup to use bcrypt comparison (bcrypt.CompareHashAndPassword) rather than direct SQL equality, mirroring the existing CalDAV token implementation in the same file.
If possible, please apply for a CVE number when posting.
References
- https://github.com/advisories/GHSA-r6w9-259g-gwrv
- https://github.com/go-vikunja/vikunja/security/advisories/GHSA-r6w9-259g-gwrv
- https://github.com/go-vikunja/vikunja/commit/00fd2c6155c01faae99be4226b931d8091fd6323
- https://github.com/go-vikunja/vikunja/commit/3a0ea15d8c18ff960bc98ae39950fa7a14b0af7d
- https://github.com/go-vikunja/vikunja/commit/e31ea2de5040fa63bc97cf4df63bafed3bd9ad85
- https://github.com/go-vikunja/vikunja/releases/tag/v2.4.0
Related vulnerabilities
All Supply chain →- MEDIUMCVE-2026-91982
Vikunja: TOTP secret is readable after enrollment, no step-up auth
- HIGHCVE-2026-107807
Nginx UI: Node Secret Credential Exposure via URL Query Parameter
- MEDIUMCVE-2026-105804
Payload: Password hashes use insufficient PBKDF2 iterations
- MEDIUMCVE-2026-77250
MCP Atlassian: OAuth fallback token storage writes plaintext access and refresh tokens with group-readable permissions
- MEDIUMCVE-2026-63406
AnyCable: Telemetry Subsystem Contains Hardcoded Authentication Token and Transmits CLI Arguments Including Secrets
- HIGHSC-ARTIPACKED-2024
On August 13, 2024, Palo Alto Networks Unit 42 published ArtiPACKED, a widespread CI/CD misconfiguration class in which GitHub Actions build artifacts inadvertently leaked authentication tokens, affecting major open-source projects from Google, Microsoft, Red Hat, AWS, Canonical, and OWASP. The root cause is that actions/checkout persists credentials by default, writing the workflow's GITHUB_TOKEN into the checked-out .git/config for authenticated Git operations; when a later step uploaded the workspace (test results, build output, or the full checkout directory) via actions/upload-artifact, the .git directory and its embedded token, along with environment-derived secrets and cloud credentials, were packaged into the downloadable artifact. Because v4 artifacts can be downloaded while the run is still in progress and are readable by anyone for public repositories, an attacker could win a race condition: download the artifact, extract the still-valid GITHUB_TOKEN before the job completed and the token expired, and use it to push code, create branches, or pivot into connected cloud environments. Unit 42 identified numerous large projects leaking tokens this way and disclosed each responsibly for remediation.