Summary
FreeScout's mailbox signature handling can allow a user who can edit a signature to bypass dangerous-tag filtering by combining nested tag fragments with a scriptable uploaded file. When another user opens the affected reply editor or new-ticket page, the same-origin script may run with that user's FreeScout privileges.
Affected context
The issue occurs in FreeScout mailbox signature handling when uploaded scriptable files are combined with nested tag fragments that bypass Helper::stripDangerousTags(). The resulting external script is served from the same origin, so a script-src 'self' policy does not block it when another user opens the affected mailbox reply editor or new-ticket page.
Exploit preconditions
- Attack surface: Mailbox signature editing and the
/uploads/uploadendpoint - Required access: Permission to edit a mailbox signature and upload a scriptable file
- Trigger point: Another user opens the affected mailbox reply editor or new-ticket page
- Why exploitation is possible: Nested tag fragments bypass dangerous-tag filtering, and the resulting script is served from the same origin allowed by the policy
Why this happens
The vulnerability is an output-sanitization failure that enables stored cross-site scripting. The dangerous-tag filtering can be bypassed with nested tag fragments, while a scriptable uploaded file remains accessible from the application origin. This maps to CWE-79: Improper Neutralization of Input During Web Page Generation, because attacker-controlled content is included in a page in a way that permits script execution.
Potential impact
- Attacker-controlled script may run in a victim's authenticated browser session
- The script could read data visible to the victim in FreeScout
- The script could perform same-origin actions using the victim's privileges
- Sensitive mailbox information or account functions may be exposed or misused
General mitigation guidance
Mitigation generally focuses on preventing untrusted content from becoming executable in application pages.
Common defensive patterns include:
- Applying context-aware output encoding to user-controlled content
- Sanitizing markup with a strict allowlist and handling nested or malformed tags safely
- Restricting uploads to non-executable file types and serving them from a separate origin
- Avoiding reliance on
script-src 'self'as the sole control for uploaded content - Limiting mailbox-editing and upload permissions to trusted users
How teams detect issues like this
Useful detection approaches include:
- Static analysis and code review for unsafe HTML rendering and incomplete sanitization of nested markup
- Reviewing upload handling, allowed file types, and whether uploaded content is served from the application origin
- Testing signature rendering in reply editors and new-ticket pages with security-focused input cases
- Enforcing policies that require context-aware encoding and restrict executable uploads
- Monitoring for unexpected scriptable files and suspicious changes to mailbox signatures

