CVE-2026-52827: Kimai Pre-2FA KIMAI_SESSION cookie Grants Full Authenticated Vulnerability

HIGH
Advisory Identifier: GHSA-v8hx-4vx8-wc96
CWE-287
Published
Advisory Summary

CVE-2026-52827 is a HIGH pre-2fa kimai_session cookie grants full authenticated vulnerability (CWE-287: Improper Authentication) affecting Kimai libraries in the Packagist ecosystem. The issue involves pre-2fa kimai_session cookie grants full authenticated rest api access, bypassing totp. Remediation is available by upgrading affected packages to version 2.59.0.

CVE-2026-52827 at a Glance

CVE Identifier CVE-2026-52827
GHSA Identifier GHSA-v8hx-4vx8-wc96
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-287: Improper Authentication
Affected Product Kimai
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-52827

To remediate this vulnerability, upgrade all affected Kimai dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

kimai/kimai fixed: 2.59.0
Upgrade kimai/kimai to 2.59.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for kimai/kimai

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-52827, inspect your project dependencies for Kimai:

inspect dependencies for kimai/kimai

Analyze the terminal output to locate any version of Kimai in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.59.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. In Kimai, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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](https://www.kimai.org/en/security/ghsa-v8hx-4vx8-wc96) for more information.

CVE-2026-52827 Affected Kimai Versions

1 component(s)
Fixed Versions:
2.59.0
Product / Package Ecosystem Affected Versions Fixed Version
kimai/kimai
Packagist
< 2.59.0
2.59.0

References

Frequently Asked Questions

What is CVE-2026-52827?
CVE-2026-52827 is a security vulnerability in Kimai involving Pre-2FA KIMAI_SESSION cookie grants full authenticated REST API access, bypassing TOTP under CWE-287: Improper Authentication.
Which Kimai versions are affected?
Affected versions include releases prior to 2.59.0 across affected packages: kimai/kimai.
What version fixes CVE-2026-52827?
Upgrading to 2.59.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is kimai/kimai affected?
Yes, kimai/kimai is affected in releases prior to 2.59.0. Upgrade your dependency to 2.59.0 or later.
What CWE is associated with CVE-2026-52827?
CVE-2026-52827 is classified under CWE-287: Improper Authentication (When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct.).
How can I check Packagist dependencies for CVE-2026-52827?
Run the dependency tree command: 'inspect dependencies for kimai/kimai'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-v8hx-4vx8-wc96",
  "modified" : "2026-07-14T00:33:39Z",
  "published" : "2026-07-14T00:33:39Z",
  "aliases" : [ "CVE-2026-52827" ],
  "summary" : "Kimai: Pre-2FA KIMAI_SESSION cookie grants full authenticated REST API access, bypassing TOTP",
  "details" : "### Summary\nTwo-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.\n\nSo 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.\n\n### Details\n\n#### Affected Component\n- The API firewall / authorization.\n\n`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.\n\n### PoC\n\n_A PoC was provided, but removed for security reasons._\n\n### Impact\n\nTwo-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.\n\n## Solution\n\n- 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.\n- 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.\n- Regression tests were added to prevent future escalation of the same issue.\n\nSee [https://www.kimai.org/en/security/ghsa-v8hx-4vx8-wc96](https://www.kimai.org/en/security/ghsa-v8hx-4vx8-wc96) for more information.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "kimai/kimai"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.59.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/kimai/kimai/security/advisories/GHSA-v8hx-4vx8-wc96"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/kimai/kimai"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-287" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-14T00:33:39Z",
    "nvd_published_at" : null
  }
}