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