{"id":"CVE-2026-40479","aliases":["CVE-2026-40479","GHSA-g82g-m9vx-vhjg"],"related":[],"kind":"vulnerability","state":"published","title":"Kimai: Stored XSS via Incomplete HTML Attribute Escaping in Team Member Widget","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\nThe 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.\n\n### Details\nIncomplete security patch. The `escapeForHtml()` function was meant to prevent XSS but missed quote characters, which are critical for HTML attribute context escaping.\n\n**Vulnerable code** — `assets/js/plugins/KimaiEscape.js:29-33`:\n```javascript\nconst tagsToReplace = {\n    '&': '&amp;',\n    '<': '&lt;',\n    '>': '&gt;',\n    // MISSING: '\"': '&quot;'\n    // MISSING: \"'\": '&#039;'\n};\n```\n\n**Affected code files**:\n- `assets/js/plugins/KimaiEscape.js:24-38` — incomplete escape function\n- `assets/js/forms/KimaiTeamForm.js:77,86` — replacement + innerHTML\n- `templates/macros/widgets.html.twig:126` — `title=\"{{ tooltip }}\"` in avatar macro\n- `templates/form/blocks.html.twig:104` — `{{ widgets.avatar('__INITIALS__', '__COLOR__', '__DISPLAY__') }}`\n\n### PoC\n[poc.zip](https://github.com/user-attachments/files/26537515/poc.zip)\n\nPlease extract the uploaded compressed file before proceeding\n\n1. ./setup.sh\n2. ./poc_xss.sh\n\n<img width=\"751\" height=\"155\" alt=\"스크린샷 2026-04-07 오후 9 06 27\" src=\"https://github.com/user-attachments/assets/c09a23fb-f60b-49dd-9018-8c723e35b4c4\" />\n\n### Impact\n- Stored XSS: payload persists in the database (user alias field)\n- Privilege escalation: ROLE_USER injects XSS that executes in ROLE_ADMIN/ROLE_SUPER_ADMIN browser session","format":"markdown","source":"ghsa"}],"published":"2026-04-15T19:46:35.000Z","modified":"2026-06-17T10:45:21.180Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":">= 1.16.3, < 2.53.0","status":"affected"}],"vendor":"kimai","product":"kimai","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.53.0"}],"ecosystem":"Packagist","package":"kimai/kimai","purl":"pkg:composer/kimai/kimai","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.53.0"}],"vendor":"kimai","product":"kimai","cpe":"cpe:2.3:a:kimai:kimai:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/kimai/kimai/security/advisories/GHSA-g82g-m9vx-vhjg","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/kimai/kimai/releases/tag/2.53.0","tags":["product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40479","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/kimai/kimai/pull/2959","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/kimai/kimai","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-04-20T16:09:41.078Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-40479","url":"https://www.cve.org/CVERecord?id=CVE-2026-40479","licence":"CVE Terms of Use","modified":"2026-04-20T16:16:41.880Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-g82g-m9vx-vhjg","url":"https://github.com/advisories/GHSA-g82g-m9vx-vhjg","licence":"CC-BY-4.0","modified":"2026-05-05T16:07:09.862Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-40479","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40479","licence":"Public domain","modified":"2026-06-17T10:45:21.180Z"}],"updatedAt":"2026-11-25T22:59:18.977Z","epss":{"score":0.00215,"percentile":0.12705,"date":"2026-12-01T12:00:22.000Z"}}