CVE-2026-40479: Kimai: Stored XSS via Incomplete HTML Attribute Escaping in Team Member Widget

Published Apr 15, 2026
·
Updated

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: javascript 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. ./pocxss.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: ROLEUSER injects XSS that executes in ROLEADMIN/ROLESUPERADMIN browser session

Other sources

Kimai is an open-source time tracking application. In versions 1.16.3 through 2.52.0, the escapeForHtml() function in KimaiEscape.js does not escape double quote or single quote characters. When a user's profile alias is inserted into an HTML attribute context via the team member form prototype and rendered through innerHTML, this incomplete escaping allows HTML attribute injection. An authenticated user with ROLEUSER privileges can store a malicious alias that executes JavaScript in the browser of any administrator viewing the team form, resulting in stored XSS with privilege escalation. This issue has been fixed in version 2.53.0.

MITRE

Affected Software

2 affected componentsFixes available
composer/kimai/kimai<2.53.0
2.53.0
Kimai Kimai<2.53.0

Event History

Apr 15, 2026
Advisory Published
via GitHub·07:46 PM
Data Sourced
via GitHub·07:46 PM
DescriptionSeverityWeaknessAffected Software
Apr 17, 2026
CVE Published
via MITRE·10:31 PM
Data Sourced
via MITRE·10:31 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·11:16 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-40479?

CVE-2026-40479 has been classified as a moderate severity vulnerability due to its potential for XSS attacks.

2

How do I fix CVE-2026-40479?

To fix CVE-2026-40479, upgrade to Kimai version 2.53.0 or later.

3

What type of vulnerability is CVE-2026-40479?

CVE-2026-40479 is a client-side JavaScript cross-site scripting (XSS) vulnerability.

4

What components are affected by CVE-2026-40479?

CVE-2026-40479 specifically affects the `escapeForHtml()` function in `KimaiEscape.js`.

5

What user-controlled data can be exploited in CVE-2026-40479?

In CVE-2026-40479, the vulnerability can be exploited through user-controlled data such as profile aliases.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203