Leantime has HTML injection through firstname and lastname fields

Description

Summary

Leantime 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.

Vulnerable File

app/Domain/Users/Templates/editUser.tpl.php

Vulnerable Code (Lines ~14-17)

value="<?php echo $values['firstname'] ?>"
value="<?php echo $values['lastname'] ?>"

These fields output raw user input without sanitization.

Steps to Reproduce

  1. Login as admin > Go to Settings > Users > Edit any user
  2. Enter HTML payload in First Name or Last Name field:
    <h1>INJECTED</h1>
  3. Save the user profile
  4. Create or view an article — the injected HTML renders in the author name

Fix

Replace unescaped echo with htmlspecialchars():

value="<?php echo htmlspecialchars($values['firstname'], ENT_QUOTES, 'UTF-8') ?>"
value="<?php echo htmlspecialchars($values['lastname'], ENT_QUOTES, 'UTF-8') ?>"

Or use the existing $this->e() helper already used in editOwn.tpl.php.

Impact

  • Stored HTML injection visible to all users viewing affected content
  • Can be used for phishing, fake login forms, and UI defacement
  • Affects all versions before 3.3.0

Basic information

Type
reviewed
Severity
medium
Advisory on GitHub
Open advisory ↗
Repository advisory
Open repository advisory ↗
Source code
Browse source ↗
Published (advisory)
2026-03-05 18:05:57 UTC
Updated
2026-03-05 18:05:59 UTC
GitHub reviewed
2026-03-05 18:05:57 UTC

CVSS Scores

Base score Version Severity Vector
5.4 3.1
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:L)
A normal user session is enough; they don’t have to be admin.
User interaction (UI:R)
A real person has to do something—click, install, enable—otherwise it doesn’t land.
Scope (S:C)
Breaking this can reach past the original component and bite other resources—bigger blast radius.
Confidentiality (C:L)
Some sensitive info could get out, but not a total data dump.
Integrity (I:L)
Attackers could change some data, but it’s limited—not everything goes.
Availability (A:N)
Service keeps running; no real outage angle.

Identifiers

Type Value
GHSA GHSA-qrfh-cc86-vc8c ↗

CWEs

CWE id Name
CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Credits

  • PratikKaran23 (reporter)

Affected packages (1)

Vulnerable version ranges and first patched releases as published by GitHub.

Ecosystem Package Vulnerable range First patched Vulnerable functions
composer leantime/leantime < 3.3.0 3.3.0

References

cvelogic Threat Intelligence