Medium

Kimai has Stored XSS via Incomplete HTML Attribute Escaping in Team Member Widget

  • Disclosed: 15.04.2026
  • Updated: 11.10.2026 10:22

Summary

The client-side escapeForHtml() function in KimaiEscape.js, introduced in commit 89bfa82c (#2959) to fix a JavaScript XSS vulnerability, only escapes <, >, and & but does not escape " (double quote) or ' (single quote). When user-controlled data (profile alias) is placed in an HTML attribute context (title="__DISPLAY__") via the team member form prototype and rendered through innerHTML, the missing quote escaping allows HTML attribute injection, resulting in Stored XSS.

Details

Incomplete security patch. The escapeForHtml() function was meant to prevent XSS but missed quote characters, which are critical for HTML attribute context escaping.

Vulnerable code — assets/js/plugins/KimaiEscape.js:29-33:

js
const tagsToReplace = {
    '&': '&amp;',
    '<': '&lt;',
    '>': '&gt;',
    // MISSING: '"': '&quot;'
    // MISSING: "'": '&#039;'
};

Affected code files:

  • assets/js/plugins/KimaiEscape.js:24-38 — incomplete escape function
  • assets/js/forms/KimaiTeamForm.js:77,86 — replacement + innerHTML
  • templates/macros/widgets.html.twig:126 — title="{{ tooltip }}" in avatar macro
  • templates/form/blocks.html.twig:104 — {{ widgets.avatar('__INITIALS__', '__COLOR__', '__DISPLAY__') }}

PoC

poc.zip

Please extract the uploaded compressed file before proceeding

  1. ./setup.sh
  2. ./poc_xss.sh
<img width="751" height="155" alt="스크린샷 2026-04-07 오후 9 06 27" src="https://github.com/user-attachments/assets/c09a23fb-f60b-49dd-9018-8c723e35b4c4" />

Impact

  • Stored XSS: payload persists in the database (user alias field)
  • Privilege escalation: ROLE_USER injects XSS that executes in ROLE_ADMIN/ROLE_SUPER_ADMIN browser session

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Composer package kimai/kimai < 2.53.0 2.53.0

References

CVSS score 5.4/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
Weakness (CWE)
CWE-79
Platform
Composer
Package
kimai/kimai
Disclosed
15.04.2026
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-g82g-m9vx-vhjg - CC BY 4.0

Vulnerability history: kimai/kimai

All published vulnerabilities of this package (Composer package), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (33) in the archive
Total entries
33
First → latest
02.2023 07.2026
Without a fix
1
Exploited in attacks
0

Severity breakdown

  • Critical 2
  • High 4
  • Medium 20
  • Low 7

Disclosures per year

  1. 2023: 2
  2. 2024: 3
  3. 2025: 1
  4. 2026: 27
Severity:
  1. Kimai has Stored XSS via Incomplete HTML Attribute Escaping in Team Member Widget this entry
    Medium · 5.4 CVE-2026-40479 < 2.53.0 2.53.0
  2. High · 9.8 CVE-2023-53957 <= 1.30.10 no fix
  3. High · 6.5 ghsa-534c-hcr7-67jg < 2.21.0 2.21.0
  4. Critical · 9.6 CVE-2020-19825 < 1.1 1.1

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.