{"id":"GHSA-qrfh-cc86-vc8c","aliases":[],"url":"https://o3.security/vulnerability/GHSA-qrfh-cc86-vc8c","summary":"Leantime has HTML injection through firstname and lastname fields","details":"### 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","published":"2026-03-05T18:05:57Z","modified":"2026-03-05T18:16:35.270983Z","cvss":{"score":5.4,"severity":"MEDIUM","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N"},"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Packagist","name":"leantime/leantime","fixedVersion":"3.3.0"}],"fix":{"url":"https://github.com/Leantime/leantime/commit/3f8b2c6346111694bb18cec558b27c22d3a2b9d1","label":"Leantime/leantime@3f8b2c6"},"references":[{"type":"WEB","url":"https://github.com/Leantime/leantime/security/advisories/GHSA-qrfh-cc86-vc8c"},{"type":"WEB","url":"https://github.com/Leantime/leantime/commit/3f8b2c6346111694bb18cec558b27c22d3a2b9d1"},{"type":"PACKAGE","url":"https://github.com/Leantime/leantime"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-03-05T18:16:35.270983Z"}}