5.4medium
Kimai: Stored XSS via Incomplete HTML Attribute Escaping in Team Member Widget
- Severity
- 5.4medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.21% (higher than 12% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-g82g-m9vx-vhjg
Description
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 ROLE_USER 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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| kimai kimai | >= 1.16.3, < 2.53.0, before 2.53.0 | CVE List, NVD |
| kimai/kimai (Packagist) | before 2.53.0 | GitHub Advisory Database |
All scores
| GitHub_M | 5.4medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N |
| GitHub | 5.4medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.
What each source says
CVE List
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 ROLE_USER 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.
GitHub Advisory Database
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:
const tagsToReplace = {
'&': '&',
'<': '<',
'>': '>',
// MISSING: '"': '"'
// MISSING: "'": '''
};
Affected code files:
assets/js/plugins/KimaiEscape.js:24-38— incomplete escape functionassets/js/forms/KimaiTeamForm.js:77,86— replacement + innerHTMLtemplates/macros/widgets.html.twig:126—title="{{ tooltip }}"in avatar macrotemplates/form/blocks.html.twig:104—{{ widgets.avatar('__INITIALS__', '__COLOR__', '__DISPLAY__') }}
PoC
Please extract the uploaded compressed file before proceeding
- ./setup.sh
- ./poc_xss.sh
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
References
| https://github.com/kimai/kimai/security/advisories/GHSA-g82g-m9vx-vhjg | exploit, vendor-advisory, web | |
| https://github.com/kimai/kimai/releases/tag/2.53.0 | product, release-notes, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-40479 | advisory | |
| https://github.com/kimai/kimai/pull/2959 | web | |
| https://github.com/kimai/kimai | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-40479 changed 2026-04-20 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-g82g-m9vx-vhjg changed 2026-05-05 | CC-BY-4.0 |
| NVD | CVE-2026-40479 changed 2026-06-17 | Public domain |