CVE-2026-40479: Kimai: Stored XSS via Incomplete HTML Attribute Escaping in Team Member Widget
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 = { '&': '&', '<': '<', '>': '>', // MISSING: '"': '"' // MISSING: "'": ''' };
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
Event History
Frequently Asked Questions
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.
How do I fix CVE-2026-40479?
To fix CVE-2026-40479, upgrade to Kimai version 2.53.0 or later.
What type of vulnerability is CVE-2026-40479?
CVE-2026-40479 is a client-side JavaScript cross-site scripting (XSS) vulnerability.
What components are affected by CVE-2026-40479?
CVE-2026-40479 specifically affects the `escapeForHtml()` function in `KimaiEscape.js`.
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.