FreeScout Zero-Click RCE via Email Attachment Filename Sanitization Bypass ("Mail2Shell") — CVE-2026-28289
by 0xAshwesker (Ashwesker) · 2026-07-05
- Severity
- Critical
- CVE
- CVE-2026-28289
- Category
- web
- Affected product
- FreeScout helpdesk/mailbox application
- Affected versions
- <= 1.8.206 (patched in 1.8.207)
- Disclosed
- 2026-07-05
- Patch status
- patched
Tags
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-05 |
| Last Updated | 2026-03 |
| Author / Researcher | 0xAshwesker (Ashwesker) |
| CVE / Advisory | CVE-2026-28289 |
| Category | web |
| Severity | Critical |
| CVSS Score | 10.0 (per repo README) |
| Status | Weaponized |
| Tags | freescout, rce, zero-click, email-attachment, htaccess-bypass, unicode-bypass, webshell, helpdesk |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | FreeScout helpdesk/mailbox application |
| Versions Affected | <= 1.8.206 (patched in 1.8.207) |
| Language / Platform | Python 3 (smtplib-based PoC), target is PHP/Apache |
| Authentication Required | No |
| Network Access Required | Yes (email delivery to a mailbox monitored by FreeScout) |
Summary
FreeScout automatically saves incoming email attachments to a predictable, web-accessible storage path, and attempts to block dangerous filenames such as .htaccess. This PoC bypasses that filter by prepending a zero-width Unicode character to the .htaccess filename, which slips past the sanitization check while still being interpreted by Apache as a real .htaccess file. The attacker emails both this bypassed .htaccess (which sets AddHandler application/x-httpd-php .txt) and a webshell.txt file (containing a PHP command-execution snippet) as attachments to any address monitored by the target FreeScout instance. Once FreeScout saves the attachments, the attacker locates the resulting attachment directory and directly requests webshell.txt?cmd=<command> over HTTP to achieve unauthenticated, zero-click remote code execution as the web server user.
Vulnerability Details
Root Cause
Incomplete filename sanitization: FreeScout’s attachment filter blocks the literal string .htaccess but does not normalize Unicode before the check, so a filename prefixed with a zero-width space (.htaccess) bypasses the block while the filesystem still treats it as a functional .htaccess file that Apache honors via AllowOverride.
Attack Vector
- Craft two attachments: a zero-width-space-prefixed
.htaccessthat maps.txtextensions to the PHP handler, and awebshell.txtcontaining ashell_exec-based command runner. - Email both attachments to any address monitored by the target FreeScout mailbox — no authentication or user interaction on the target is required.
- FreeScout automatically stores the attachments under a predictable, web-accessible
storage/attachment/<date>/<id>/path. - Locate the resulting path (e.g. via server access during testing, or through predictable/enumerable directory structure) and request
webshell.txt?cmd=<command>directly over HTTP. - The malicious
.htaccesscauses Apache to executewebshell.txtas PHP, running the attacker’s command and returning output in the response.
Impact
Full unauthenticated, zero-click remote code execution as the web server user (e.g. www-data) on any internet-facing FreeScout instance that accepts inbound email, leading to complete server compromise.
Environment / Lab Setup
Target: FreeScout <= 1.8.206 with Apache (AllowOverride enabled) and inbound email processing configured
Attacker: Python 3, SMTP credentials/relay to deliver the crafted email, SSH/browser access to locate and hit the resulting webshell path
Proof of Concept
PoC Script
See
Mail2Shell.pyin this folder.
| |
Prompts for SMTP credentials, generates the zero-width-space .htaccess and webshell.txt payloads, emails them as attachments to the target FreeScout mailbox, then prints instructions for locating the saved attachment path and invoking webshell.txt?cmd=whoami to confirm RCE.
Detection & Indicators of Compromise
Signs of compromise:
.htaccessfiles with unusual/zero-width characters appearing understorage/attachment/.- Unexplained
.txtfiles being served with PHP execution / returning command output. - Inbound emails with attachments named similarly to
.htaccessor generic webshell filenames.
Remediation
| Action | Detail |
|---|---|
| Primary fix | Upgrade FreeScout to 1.8.207 or later |
| Interim mitigation | Disable AllowOverride All for attachment directories, restrict execution of scripts within storage/attachment/, and monitor/reject attachments containing non-standard Unicode in filenames. |
References
Notes
Mirrored from https://github.com/0xAshwesker/CVE-2026-28289 on 2026-07-05.
| |