GitHub Advisoryadvisory · Packagist

GHSA-g82g-m9vx-vhjg Kimai has Stored XSS via Incomplete HTML Attribute Escaping in Team Member Widget

MEDIUM Published 2026-04-15 Modified 2026-04-27 Official page ↗
Aliases
CVE-2026-40479
Ecosystem
Packagist
Packages
kimai/kimai
Severity
Moderate
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
Weaknesses
CWE-79
Reviewed
2026-04-15

Affected packages

• Packagist kimai/kimai: < 2.53.0 → fixed in 2.53.0

Description

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;', '': '&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 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

Related

Alias · CVE (1)

  • CVE-2026-40479 Kimai is an open-source time tracking application. vulnerability

Weakness · CWE (1)

  • CWE-79 Improper Neutralization of Input During Web Page Generation weakness

References