Skip to main content

Kimai CVE-2026-52827

HIGH
Improper Authentication (CWE-287)
2026-07-14 https://github.com/kimai/kimai GHSA-v8hx-4vx8-wc96
Share

Severity by source

vuln.today AI
9.1 CRITICAL

Network-reachable API replay with no user interaction; password is the attacker's own stolen input (the factor 2FA defends), so PR:N; full API read/write yields C:H/I:H, no availability impact.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N

Lifecycle Timeline

3
Source Code Evidence Fetched
Jul 14, 2026 - 01:01 vuln.today
Analysis Generated
Jul 14, 2026 - 01:01 vuln.today
CVE Published
Jul 14, 2026 - 00:33 cve.org
HIGH

DescriptionCVE.org

Summary

Two-factor authentication (TOTP) can be fully bypassed for the REST API. The KIMAI_SESSION cookie returned in the response to the login request; issued after only the password is verified, before the TOTP step; is already accepted as authenticated by every /api/* endpoint.

So after submitting just the password, the web UI correctly holds the browser at the TOTP screen (/en/auth/2fa), but the cookie from that same login response can be replayed against the API to act as the user without ever entering the second factor. This affects any account with 2FA enabled and requires only the account password.

Details

Affected Component
  • The API firewall / authorization.

config/packages/security.yaml guards the API with { path: '^/api', roles: IS_AUTHENTICATED }. During 2FA the session carries a Scheb TwoFactorToken, which satisfies IS_AUTHENTICATED (it is a real, non-anonymous token). App\API\Authentication\ApiRequestMatcher returns !$request->hasPreviousSession(), so a request that carries the login session skips the stateless API firewall and is served by the main session firewall; Scheb's TwoFactorAccessDecider::isAccessible() then evaluates IS_AUTHENTICATED to true for ^/api and lets it through, and App\Voter\ApiVoter grants API to any token whose user is a User. Web routes are not affected because they require concrete roles (e.g. ROLE_USER) that a TwoFactorToken does not hold.

PoC

_A PoC was provided, but removed for security reasons._

Impact

Two-factor authentication provides no protection for the REST API. If an attacker obtains a user's password (phishing, credential stuffing, reuse, breach); exactly the threat 2FA is meant to defend against; they get full authenticated API access as that user without the second factor. The whole exploit is a single cookie taken from the login response; no API token, Bearer header or CSRF token is required.

Solution

  • The /api/ firewall now uses IS_AUTHENTICATED_REMEMBERED which is only assigned after 2FA. The historically used IS_AUTHENTICATED flag is applied immediately after login and before 2FA happened.
  • The APIVoter checks both $token instanceof TwoFactorTokenInterface and isGranted('IS_AUTHENTICATED_2FA_IN_PROGRESS', $user) to make sure that the user is not currently in the 2FA step.
  • Regression tests were added to prevent future escalation of the same issue.

See https://www.kimai.org/en/security/ghsa-v8hx-4vx8-wc96 for more information.

AnalysisAI

Two-factor authentication bypass in Kimai (open-source time-tracking) before 2.59.0 lets an attacker with only a victim's password reach every authenticated REST API endpoint without completing TOTP. The KIMAI_SESSION cookie returned by the password-only login response - issued before the 2FA step - is already treated as authenticated by /api/*, so it can be replayed to act fully as the user while the browser is still pinned to the 2FA screen. No public exploit identified at time of analysis (a PoC existed but was redacted by the reporter); not listed in CISA KEV.

Technical ContextAI

Kimai is a PHP/Symfony application; the flaw lives in its Symfony Security firewall configuration and the Scheb TwoFactorBundle used for TOTP. In config/packages/security.yaml the API is guarded by { path: '^/api', roles: IS_AUTHENTICATED }. During the 2FA challenge Symfony holds a Scheb TwoFactorToken, which is a real, non-anonymous token and therefore satisfies IS_AUTHENTICATED even though the second factor has not been supplied. App\API\Authentication\ApiRequestMatcher returns !$request->hasPreviousSession(), so a request carrying the login session bypasses the stateless API firewall and is handled by the main session firewall; Scheb's TwoFactorAccessDecider::isAccessible() then evaluates IS_AUTHENTICATED as true for ^/api, and App\Voter\ApiVoter grants the API attribute to any token whose user is a User. This is a textbook CWE-287 (Improper Authentication) root cause: an authorization check keyed on a too-weak authentication state (IS_AUTHENTICATED rather than a post-2FA state). Web UI routes are unaffected because they demand concrete roles such as ROLE_USER that a TwoFactorToken does not carry. The affected package is pkg:composer/kimai/kimai.

RemediationAI

Vendor-released patch: upgrade Kimai to 2.59.0 or later, which changes the /api firewall to require IS_AUTHENTICATED_REMEMBERED (only granted after 2FA) instead of IS_AUTHENTICATED, and hardens ApiVoter to reject tokens that are a TwoFactorTokenInterface or where IS_AUTHENTICATED_2FA_IN_PROGRESS holds for the user. Until you can upgrade, the practical compensating controls are to restrict or disable REST API exposure - for example block or firewall the ^/api path at the reverse proxy for untrusted networks so only trusted hosts can reach it (side effect: breaks legitimate API integrations), and to invalidate existing sessions and force credential resets if you suspect password compromise. Because the flaw makes 2FA ineffective for the API, do not treat TOTP as sufficient protection for the API in the meantime; prioritize strong, unique passwords and monitor API access logs for sessions acting via /api/* without a completed 2FA step. See the advisory at https://github.com/kimai/kimai/security/advisories/GHSA-v8hx-4vx8-wc96 and https://www.kimai.org/en/security/ghsa-v8hx-4vx8-wc96.

Share

CVE-2026-52827 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy