- to
- /var/www
- from
- authorized sender (spoofed)
- re
- CVE-2026-130596
- file
- ../../../x.pdf
Fax escape: a path traversal in FusionPBX fax-to-email
read the reportOn this page
- Introduction
- Vulnerability Discovered
- CVE-2026-130596: Path Traversal via Fax Email Attachment Filename
- How the Fax Mailbox Works
- Two Weak Links
- The Sender Check Trusts a Header
- The Filename Is Not Treated as Untrusted
- The uuid- Prefix Does Not Help
- Impact Analysis
- What an Attacker Gets
- Why It Is Rated Medium
- Remediation Recommendations
- Short-Term
- What Upstream Changed
- Long-Term
- About This Page
- Timeline
- References
Introduction
FusionPBX is an open-source web interface for managing FreeSWITCH phone systems. One of its features is fax by email: a mailbox is polled over IMAP, and any message that carries the right subject tag from an authorized sender is turned into an outgoing fax.
The script that does the polling, app/fax/fax_emails.php, takes the filename of each attachment from the email and uses it to build a path on disk. That filename is chosen by whoever sent the message, and the script never checks that the finished path still points inside the folder it meant to write to.
- What it allows: creating or overwriting files that the web server can write to, outside the fax temp folder, as long as the name ends in an allowed extension (
.pdf,.tifor.tiffby default) - Who can do it: anyone who can email the polled mailbox with a believable sender address. No login or PBX account is needed.
- Affected: FusionPBX through 5.6.5
- Fixed: upstream, in two commits linked below
Vulnerability Discovered
CVE-2026-130596: Path Traversal via Fax Email Attachment Filename
Severity: Medium (CVSS 4.0: 6.3)
The CVE record lists two scores, and both land in Medium. This page leads with the CVSS 4.0 score, 6.3, the newer of the two scoring systems. The same record also gives CVSS 3.1 as 4.8. Both vectors rate attack complexity High. The weakness class is CWE-22, Improper Limitation of a Pathname to a Restricted Directory.
Affected File: app/fax/fax_emails.php
How the Fax Mailbox Works
For each fax account that has an email connection configured, the script does roughly this:
- Opens the account's IMAP mailbox and searches for messages whose subject contains the configured tag.
- Reads the sender from the message's
Fromheader and checks it against the account's list of authorized senders (full addresses or whole domains). - Parses the message into a body and attachments.
- For each attachment, takes the file extension from the attachment's own name and keeps it only if it is on an allowlist. The default allowlist is
.pdf,.tiffand.tif. - Saves the attachment into the fax temp folder and hands it to the fax sender.
The script is run by the mail cron job rather than by a logged-in user, so there is no session to check, and the mailbox is reachable from the internet by design: it has to accept mail from outside.
Step 5 is where the path is built. This is the code at the commit the advisory points to:
$uuid_filename = uuid();
$local_filepath = $fax_dir.'/'.$fax_extension.'/temp/'.$uuid_filename."-".$attachment['name'];
file_put_contents($local_filepath, $attachment['data']);
Everything in $attachment['name'] comes straight from the email. The extension check in step 4 reads only the end of that same string, so a name that passes the allowlist can still contain directory separators and ../ sequences in the middle.
Two Weak Links
The Sender Check Trusts a Header
"Authorized sender" is decided by comparing the address in the From header with a list. That header is just text the sender typed. It is a name tag, not an ID check. Unless the mail system in front of the mailbox rejects forged senders (SPF, DKIM and DMARC enforcement, or a mailbox that only accepts mail from known relays), anyone who can guess or learn an authorized address or domain can claim it.
The Filename Is Not Treated as Untrusted
A filename from an email is attacker input like any other. Keeping only the part after the last slash, or ignoring the supplied name and generating one, would have closed the hole. Instead the supplied name is appended to the destination and the allowlist looks only at its suffix.
The uuid- Prefix Does Not Help
The script puts a random uuid- prefix in front of the name, which can look like protection. It is not. The prefix only attaches to the first path segment of the name, so the remaining ../ sequences still resolve and climb out of the temp folder. This was tested on Linux with PHP 8.2: a name with enough ../ sequences writes outside the folder, and one fewer than needed stays inside, because the first ../ is absorbed by the prefix.
Put together, an email that claims an authorized sender and carries an attachment whose name walks up out of the temp folder makes the polling script write the attachment's bytes somewhere it was never meant to.
Impact Analysis
What an Attacker Gets
A constrained file write. The extension is limited by the allowlist, so the written file always ends in .pdf, .tif or .tiff, but its contents are whatever the attachment contains. The target has to be writable by the web server account. In practice that means:
- overwriting any
.pdfor.tiffile that account can write, such as static assets in the web root or a fax that was received earlier - creating files with those extensions in arbitrary directories that account can write to
There is no code execution riding along. After this first write, fax_send.php renames the file using an md5 of its name and escapes it before use, so this is the only step where the attacker's name matters.
Why It Is Rated Medium
- The published vectors rate attack complexity High, and the CVSS 4.0 vector adds attack requirements Present. The preconditions are real: fax-to-email has to be configured, the attacker needs a sender address the account accepts, and the target path has to be writable.
- The impact is limited to integrity and availability of files with a small set of extensions. There is no confidentiality impact in the scoring.
- At publication, CISA's SSVC entry reads: exploitation none, automatable no, technical impact partial.
A medium score is not a reason to ignore it. A write outside the intended folder on a system that serves web content is the kind of primitive that gets chained with other weaknesses, so it is worth fixing on its own.
Remediation Recommendations
Short-Term
- Update FusionPBX to a release that includes the two upstream fixes linked below, then send a test fax by email to confirm the feature still works.
- If you do not use fax by email, turn the mailbox polling off.
- Make the mailbox reject forged senders, and allow only the relays or senders you expect.
- Give the account that runs the poller the narrowest write permissions that still let faxing work.
What Upstream Changed
The two commits carry the same message: sanitize attachment and fax file names for safety. They remove path separators from the attachment name before it is used in a local path, and they apply the same kind of cleaning to places that echo these names back: download headers, file existence checks, the fax log page and the remote inbox listing. The stated goal is to prevent path traversal and header or HTML injection when processing fax emails.
Long-Term
- Treat every filename from outside as hostile: ignore it, or reduce it to its last path component and generate the on-disk name yourself. For example:
$safe_name = preg_replace('/[^A-Za-z0-9._-]/', '_', basename($attachment['name']));
$local_filepath = $fax_dir.'/'.$fax_extension.'/temp/'.$uuid_filename.'-'.$safe_name;
- After building a path, resolve it and confirm it still sits inside the intended directory before writing.
- Do not use the
Fromheader as authentication. If a feature needs to know who sent something, verify it with a mechanism the sender cannot simply type.
About This Page
This page is built like the thing it is about. A fax machine is docked at the bottom of the screen: its keypad dials a (fictional, 555-01xx) number, and its screen draws the handshake that follows as a spectrogram: a calling tone, an answer tone, a V.21 negotiation, then the high-speed training and data bursts. The cover sheet is addressed to /var/www, and the report feeds out of the machine as you scroll.
The signal is synthesized for effect. It is not captured from a real call, and the sender and filename on the cover sheet are illustrative. The modem tones are off unless you turn them on with the sound key on the machine.
Timeline
| Date | Event | | ---------- | ---------------------------------------------------- | | 2026-11-05 | Reported to VulnCheck for coordinated disclosure | | 2026-11-07 | Upstream fix commits authored | | 2026-11-08 | Public date recorded on the CVE | | 2026-11-17 | CVE-2026-130596 reserved and published by VulnCheck | | 2026-11-17 | Entry created in the National Vulnerability Database |
Credit on the record goes to Carter LaSalle as the finder.
References
- CVE record
- NVD entry
- VulnCheck advisory
- Vulnerable code
- Upstream fixes: 8c3bb82 and f438601
comments
CVE-2026-130596Medium
Path traversal via fax email attachment filename
CVSS 4.0 score CVSS 4.06.3
app/fax/fax_emails.php