Leantime has HTML injection through firstname and lastname fields

描述

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

基本資訊

類型
reviewed
嚴重度
medium
GitHub 上的公告
開啟公告 ↗
儲存庫公告
開啟儲存庫公告 ↗
原始碼
瀏覽原始碼 ↗
公開(公告)
2026-03-05 18:05:57 UTC
更新時間
2026-03-05 18:05:59 UTC
GitHub 審核
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 點擊展開
攻擊向量 (AV:N)
可經網際網路或企業內可路由網段從遠端觸達,攻擊者不必在裝置旁邊。
攻擊複雜度 (AC:L)
前置條件清楚,成功路徑穩定,不必仰賴罕見競態或極端環境。
權限需求 (PR:L)
一般使用者權限即可,不必是管理員或 root。
使用者互動 (UI:R)
需要一次明確的使用者動作(安裝、改設定、開啟惡意文件等)才會落地。
作用域 (S:C)
可從脆弱點橫向波及其他元件或更高權限域,爆炸半徑更大。
機密性影響 (C:L)
可能外洩部分欄位或樣本資料,但難以形成「整批拖走」的局面。
完整性影響 (I:L)
能改局部紀錄或設定,但尚不致讓整站/整庫資料整體不可信。
可用性影響 (A:N)
不至於造成業務意義上的長時間停擺或災難性效能崩塌。

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