{"id":"GHSA-qrfh-cc86-vc8c","aliases":["GHSA-qrfh-cc86-vc8c"],"related":[],"kind":"vulnerability","state":"published","title":"Leantime has HTML injection through firstname and lastname fields","summary":"### Summary\nLeantime v2.3.27 is vulnerable to Stored HTML Injection. The `firstname` and `lastname` fields in the admin user edit page are rendered without  HTML escaping, allowing an authenticated user to inject arbitrary HTML that executes when the profile is viewed.\n\n### Vulnerable File\n`app/Domain/Users/Templates/editUser.tpl.php`\n\n### Vulnerable Code (Lines ~14-17)\n```php\nvalue=\"<?php echo $values['firstname'] ?>\"\nvalue=\"<?php echo $values['lastname'] ?>\"\n```\nThese fields output raw user input without sanitization.\n\n### Steps to Reproduce\n1. Login as admin > Go to Settings > Users > Edit any user\n2. Enter HTML payload in First Name or Last Name field:\n   `<h1>INJECTED</h1>`\n3. Save the user profile\n4. Create or view an article — the injected HTML renders in the author name\n\n### Fix\nReplace unescaped `echo` with `htmlspecialchars()`:\n```php\nvalue=\"<?php echo htmlspecialchars($values['firstname'], ENT_QUOTES, 'UTF-8') ?>\"\nvalue=\"<?php echo htmlspecialchars($values['lastname'], ENT_QUOTES, 'UTF-8') ?>\"\n```\nOr use the existing `$this->e()` helper already used in `editOwn.tpl.php`.\n\n### Impact\n- Stored HTML injection visible to all users viewing affected content\n- Can be used for phishing, fake login forms, and UI defacement\n- Affects all versions before 3.3.0","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"### Summary\nLeantime v2.3.27 is vulnerable to Stored HTML Injection. The `firstname` and `lastname` fields in the admin user edit page are rendered without  HTML escaping, allowing an authenticated user to inject arbitrary HTML that executes when the profile is viewed.\n\n### Vulnerable File\n`app/Domain/Users/Templates/editUser.tpl.php`\n\n### Vulnerable Code (Lines ~14-17)\n```php\nvalue=\"<?php echo $values['firstname'] ?>\"\nvalue=\"<?php echo $values['lastname'] ?>\"\n```\nThese fields output raw user input without sanitization.\n\n### Steps to Reproduce\n1. Login as admin > Go to Settings > Users > Edit any user\n2. Enter HTML payload in First Name or Last Name field:\n   `<h1>INJECTED</h1>`\n3. Save the user profile\n4. Create or view an article — the injected HTML renders in the author name\n\n### Fix\nReplace unescaped `echo` with `htmlspecialchars()`:\n```php\nvalue=\"<?php echo htmlspecialchars($values['firstname'], ENT_QUOTES, 'UTF-8') ?>\"\nvalue=\"<?php echo htmlspecialchars($values['lastname'], ENT_QUOTES, 'UTF-8') ?>\"\n```\nOr use the existing `$this->e()` helper already used in `editOwn.tpl.php`.\n\n### Impact\n- Stored HTML injection visible to all users viewing affected content\n- Can be used for phishing, fake login forms, and UI defacement\n- Affects all versions before 3.3.0","format":"markdown","source":"ghsa"}],"published":"2026-03-05T18:05:57.000Z","modified":"2026-03-05T18:16:35.270Z","severity":{"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"},"severities":[{"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":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.3.0"}],"ecosystem":"Packagist","package":"leantime/leantime","purl":"pkg:composer/leantime/leantime","source":"ghsa"}],"references":[{"url":"https://github.com/Leantime/leantime/security/advisories/GHSA-qrfh-cc86-vc8c","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/Leantime/leantime/commit/3f8b2c6346111694bb18cec558b27c22d3a2b9d1","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/Leantime/leantime","tags":["package"],"sources":["ghsa"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-qrfh-cc86-vc8c","url":"https://github.com/advisories/GHSA-qrfh-cc86-vc8c","licence":"CC-BY-4.0","modified":"2026-03-05T18:16:35.270Z"}],"updatedAt":"2026-11-25T22:56:32.873Z"}