CONTENTUM.COMA specialist. A plan. A result.

Vulnerabilities · 2026

CVE-2026-45693
Packagist vulnerability

### 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: ```php $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: ```php 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: ```php $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 control

Affected products

Packagist. The exact versions are in the references.

What to do now

  • Check your exposureFind out whether Packagist runs anywhere in your environment, including systems of suppliers.
  • UpdateInstall the version in which the vendor fixed the vulnerability. The references lead to the advisory.
  • Limit access until thenIf you cannot update at once, take the system off the internet or restrict who can reach it.

References

Data: CVE list and the NVD. This product uses data from the NVD API but is not endorsed or certified by the NVD.