/

CVE-2026-41904

Severity:

HIGH RISK

(7.6)

XSS in FreeScout Mailbox Auto-Reply Messages

CVE-2026-41904

Deferred

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Client-Side Code Execution in Recipient Mail Context

Severity:

HIGH RISK

(7.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

FreeScout versions prior to 1.8.217 contain a stored cross-site scripting (XSS) vulnerability in the mailbox auto-reply feature.

An authenticated user with the updateAutoReply permission can inject malicious script content into the auto-reply message, which is then sent unescaped to customers and executed in their webmail or mail-client context.

Affected context

The vulnerability appears in FreeScout deployments where:

  • The mailbox auto-reply feature is enabled and configurable by users with updateAutoReply permission
  • User-supplied auto-reply text is stored server-side and reused for outbound emails
  • Outgoing auto-reply emails reflect this content into HTML email bodies without proper encoding

It becomes relevant in environments where staff accounts can modify mailbox settings and customers use HTML-capable webmail or mail clients.

Exploit preconditions

  • Attack surface: Application UI for configuring mailbox auto-reply messages
  • Required access: Authenticated FreeScout user with sufficient permission (e.g., updateAutoReply) to edit auto-reply content
  • Trigger point: A customer sends an email to the affected mailbox, causing the application to send an auto-reply containing the stored payload
  • Why exploitation is possible: Auto-reply content is treated as trusted HTML and inserted into outgoing emails without appropriate escaping or sanitization, allowing script execution in HTML-capable clients that do not enforce CSP.

Why this happens

This issue stems from insufficient output encoding and validation of user-controlled content that is later rendered in an HTML context.

The auto-reply message field accepts arbitrary HTML-like input and stores it in the database. When an auto-reply email is generated, this stored content is embedded into the email body without context-appropriate escaping or sanitization.

This behavior maps to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting), where untrusted data flows directly into an HTML/JavaScript context and is interpreted by the client.

Potential impact

  • Execution of arbitrary JavaScript in the customer's webmail or mail-client context
  • Theft of session identifiers, tokens, or other sensitive data exposed in the webmail UI
  • Phishing-style content injection, such as fake login prompts or malicious links embedded in legitimate-looking auto-replies
  • Unwanted actions performed on behalf of the customer within integrated webmail services (if applicable)
  • Damage to brand trust due to customers receiving malicious content from legitimate support mailboxes

General mitigation guidance

Mitigation focuses on treating auto-reply content as untrusted input and controlling how it is rendered:

  • Apply strict, context-aware output encoding (e.g., HTML entity encoding) whenever user-supplied content is inserted into email templates.
  • Prefer plain-text storage and rendering for auto-reply messages, or restrict supported markup to a safe subset via an allowlist-based HTML sanitizer.
  • Enforce server-side validation to reject content that includes executable elements (e.g., <script>, event handlers, javascript: URLs).
  • Limit who can edit auto-reply content to the minimum set of roles required, and ensure configuration changes are auditable.
  • Standardize templating so all user-provided fields pass through centralized encoding/sanitization routines instead of custom rendering paths.

How teams detect issues like this

Detection can rely on both code- and behavior-focused approaches:

  • Static analysis: Search for email template rendering paths where user-supplied values are concatenated into HTML bodies without escaping functions or sanitization filters.
  • Template review: Inspect all mail and notification templates to verify that variables corresponding to configurable text fields are passed through standardized encoding helpers.
  • Security testing: Use automated or manual tests to inject benign HTML/JavaScript markers into configuration fields (like auto-reply messages) and observe whether they are reflected unescaped in outbound emails.
  • Policy enforcement: Adopt framework-level policies that require encoding for all user-controlled variables in HTML contexts, and use CI-integrated linters or security tools that can flag deviations.

Sources

SourceLink
github.comgithub.com/freescout-help-desk/freescout/releases/tag/1.8.217
github.comgithub.com/freescout-help-desk/freescout/security/advisories/GHSA-q3fh-rj9h-jfrc

Frequently asked

questions

Not directly. An attacker must first obtain or compromise an account with permission to edit mailbox auto-reply settings. However, once a malicious auto-reply is configured, every customer who emails the affected mailbox may receive the injected payload.

Exploitation requires authenticated access with the updateAutoReply or equivalent permission that allows editing the auto-reply message. Privilege misuse, compromised staff accounts, or shared credentials can all enable exploitation.

The safest pattern is to ensure all user-controlled content used in emails is encoded or sanitized according to its rendering context. Centralizing templating through functions that automatically apply HTML encoding, or restricting content to plain text, significantly reduces the risk.

Adopt a secure-by-default templating approach where:

  • All variables are escaped by default, with explicit opt-out only for vetted safe fragments.
  • User-configurable fields that appear in HTML emails or pages are validated and sanitized server-side.
  • Security reviews and automated checks verify that no new paths allow raw user input into HTML or script contexts.
Find out what's already
exploitable in your codebase.