Skip to main content

FacturaScripts EUVDEUVD-2026-32630

| CVE-2026-42877 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-05-07 https://github.com/NeoRazorX/facturascripts GHSA-r736-2678-fcrx
5.4
CVSS 3.1 · Vendor: https://github.com/NeoRazorX/facturascripts
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Obtain warehouse write access
  2. Delivery
    Create product with XSS payload in reference
  3. Exploit
    Await administrator to access product search modal
  4. Execution
    Click malicious product to trigger JavaScript
  5. Persist
    Execute arbitrary actions in admin session
  6. Impact
    Create new admin account or exfiltrate data

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires all of the following conditions: (1) Authenticated user account with write access to Warehouse → Products module (typically warehouse manager or admin role); (2) Ability to create or edit product records and save the 'reference' field with arbitrary content including quotes and plus signs; (3) Target user (victim) must have access to Sales → Invoices, Purchases, or Delivery Notes features and must manually open the product search modal and click on the malicious product row; (4) victim's browser must execute JavaScript from the application domain (default for any modern browser); (5) the affected PHP files (SalesModalHTML.php, PurchasesModalHTML.php) must be in use, meaning the sales/purchases search modal functionality must be enabled. The vulnerability does NOT require: special network configuration, disabled security headers, or non-default product settings. However, it is limited to authenticated attackers (PR:L in CVSS) and requires user interaction from the victim (UI:R), making it unsuitable for automated mass exploitation but well-suited for targeted privilege escalation within an organization.

Impact

CVSS 5.4 (Network, Low Complexity, Low privilege required, User interaction required, Changed scope, Low confidentiality and integrity impact) combined with confirmed POC steps and detailed reproduction instructions indicates moderate real-world risk. The requirement for authenticated user with warehouse write access and user interaction (victim must open search modal and click product) significantly limits automated exploitation compared to unauthenticated vulnerabilities. However, the practical impact is amplified by privilege escalation potential: a low-privilege warehouse employee can execute code in an administrator's authenticated session, potentially creating new admin accounts or exfiltrating sensitive business data. The absence of any vendor-released patch (vulnerable in 2025.92 with no fixed version identified) is a critical gap that elevates urgency despite the moderate CVSS score. Session cookies are HttpOnly-protected, preventing direct session hijacking via document.cookie, but this does not limit the attacker's ability to make authenticated requests on behalf of the victim. The actual exploitability depends on whether administrators regularly use the product search feature in invoices and whether warehouse staff have legitimate but limited access-a common configuration in multi-user accounting systems. No evidence of active exploitation in the wild at time of analysis.

Exploit ScenarioDerived

An employee with warehouse product management access (common in multi-user accounting systems) creates a product with reference set to x'+alert(1)+' and saves it. Days later, when a company administrator opens an invoice to process an order, clicks the product search modal button, and clicks the malicious product row in the search results, the JavaScript payload executes in the admin's authenticated browser context. The attacker's script can immediately POST to /EditUser to create a new administrator account, exfiltrate customer or financial data from the DOM, or redirect the admin to a phishing page. The attack succeeds because the admin user never triggered the vulnerability directly-the warehouse employee planted it weeks earlier in static database content.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
No patch listed yet 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 07, 2026

Stored XSS in FacturaScripts product search modal allows authenticated warehouse users to inject malicious JavaScript via product reference field, which executes in the browser of any user opening the search modal in sales or purchase documents. An attacker with warehouse write access can escalate privileges by executing arbitrary authenticated requests in an administrator's session, including creation of new admin accounts, without requiring the admin's password. The vulnerability exploits improper output encoding combined with HTML parser re-interpretation during innerHTML assignment.

RemediationAI

No vendor-released patch is currently identified at time of analysis. Immediate remediation requires either: (1) Apply the recommended fix by replacing vulnerable code in SalesModalHTML.php line 102 and equivalent line in PurchasesModalHTML.php with htmlspecialchars($row['referencia'], ENT_QUOTES, 'UTF-8') before injection into onclick attribute; (2) Replace innerHTML-based DOM insertion with innerText or DOM-based rendering to eliminate re-parsing of HTML entities and prevent the string context escape. The htmlspecialchars with ENT_QUOTES approach ensures both single and double quotes are encoded in a form that HTML parsing does not decode back into raw quotes inside JavaScript string context. As a compensating control pending patch deployment, restrict warehouse module write access to highly trusted staff only, require administrator review before opening product search modals in invoices, or implement Content Security Policy headers to restrict inline script execution-though CSP may not fully mitigate since the vulnerability involves legitimate DOM manipulation of user input rather than inline script tags. Contact vendor at https://github.com/NeoRazorX/facturascripts for patch availability and timeline.

Affected VersionsENISA

facturascripts ≤ 2025.92

Affected Packages

composer facturascripts/facturascripts no fix
euvd facturascripts no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in composer, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The vulnerability exists in PHP backend code (SalesModalHTML.php and PurchasesModalHTML.php) that constructs HTML with user-controlled product reference data injected directly into JavaScript onclick attribute context. The product reference field is processed by a noHtml() function that encodes single quotes as ' (HTML entity), which appears safe in static HTML but becomes dangerous when the generated HTML is returned as JSON and inserted into the DOM via JavaScript's innerHTML method. The innerHTML assignment triggers HTML parsing, which decodes ' back to a literal quote character, breaking out of the JavaScript string literal and executing arbitrary code. The CWE-79 classification identifies this as an Improper Neutralization of Input During Web Page Generation issue, specifically the failure to apply JavaScript context escaping (not just HTML entity encoding) before embedding user input into event handler attributes that will later be re-parsed.

Know when PHP gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/NeoRazorX/facturascripts) PRIMARY 5.4 MEDIUM
AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N

Primary rating from Vendor (https://github.com/NeoRazorX/facturascripts) · only source for this CVE.

CVSS VectorVendor: https://github.com/NeoRazorX/facturascripts

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

DescriptionCVE.org

Summary

A stored Cross-Site Scripting (XSS) vulnerability exists in the product search modal of sales and purchases documents. An authenticated user with access to the warehouse module can create a product with a malicious reference that executes arbitrary JavaScript in the browser of any other user who opens the product search modal inside an invoice, order, or delivery note.

Affected files

  • Core/Lib/AjaxForms/SalesModalHTML.php
  • Core/Lib/AjaxForms/PurchasesModalHTML.php

Vulnerability details

The referencia field of a product variant is injected directly into an HTML onclick attribute string without JavaScript context escaping:

php
// SalesModalHTML.php ~line 102
$tbody .= '<tr onclick="return salesFormAction(\'add-product\', \''
    . $row['referencia']   // no htmlspecialchars() applied
    . '\');">';

When a product is saved, noHtml() encodes ' → &#39;. This appears safe in static HTML context. However, the modal HTML is later returned as a JSON response and inserted into the DOM via innerHTML:

javascript
// SalesDocument.html.twig line 118
document.getElementById("findProductList").innerHTML = data.products;

The browser HTML parser decodes &#39; → ' during the innerHTML assignment, breaking out of the JavaScript string literal in the onclick attribute and executing the injected code.

Attack payload stored in database: x&#39;+alert(1)+&#39;

Resulting onclick after innerHTML decode:

javascript
return salesFormAction('add-product', 'x'+alert(1)+'')
//                                        ^^^^^^^^^^ executes before the function call

Steps to reproduce

Step 1 - Inject the payload

  1. Log in as a user with write access to Warehouse → Products
  2. Navigate to /EditProducto and create a new product with the following values:
FieldValue
Referencex'+alert(1)+'
Descriptiontest
  1. Save the product

Step 2 - Trigger the XSS

  1. Make sure at least one customer exists in the system (Sales → Customers)
  2. Navigate to /EditFacturaCliente?codcliente=<customer_code>
  3. In the invoice form, click the product search button next to the "Referencia" field
  4. Click on the 'malicious' product alert(1)

<img width="1162" height="536" alt="image" src="https://github.com/user-attachments/assets/aaa2879e-c1fb-4af9-8501-bac03ca24ffe" />

Impact

Although session cookies (fsLogkey, fsNick) have the HttpOnly flag set and cannot be read directly via document.cookie, the injected script runs in the victim's authenticated browser context, meaning the attacker can make arbitrary authenticated requests on their behalf, create new admin users via AJAX POST to /EditUser, exfiltrate any business data visible in the DOM, or redirect the user to an external site. The most critical scenario is privilege escalation: a low-privilege employee with only warehouse access can execute JavaScript in an administrator's session without knowing their password.

Recommended fix

Apply htmlspecialchars() with ENT_QUOTES before inserting referencia into the onclick attribute in both affected files.

Core/Lib/AjaxForms/SalesModalHTML.php

php
// Before (vulnerable):
$tbody .= '<tr onclick="return salesFormAction(\'add-product\', \''
    . $row['referencia']
    . '\');">';

// After (safe):
$tbody .= '<tr onclick="return salesFormAction(\'add-product\', \''
    . htmlspecialchars($row['referencia'], ENT_QUOTES, 'UTF-8')
    . '\');">';

Core/Lib/AjaxForms/PurchasesModalHTML.php

Apply the same change to the equivalent line.

Why ENT_QUOTES is required: ENT_QUOTES encodes both " and ' characters. This ensures that ' is stored as &#39; and - critically - remains &#39; after innerHTML assignment, because htmlspecialchars produces a form that the HTML parser does not decode back into a raw quote inside a JS string context.

Alternative mitigation: replace innerHTML with innerText or a DOM-based rendering approach that never parses injected strings as HTML. This would eliminate the entire class of HTML-injection-via-innerHTML vulnerabilities in the sales and purchases forms.

Credits

Omar Ramirez

Threat Intelligence Overview

EPSS Score
0.0%
Top 91% exploitable
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available No
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

27
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +27
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

Privilege escalation occurs when an attacker leverages flaws in access control mechanisms to gain permissions beyond what they were originally granted.

More in PHP

View all
CVE-2019-11043 CRITICAL POC
9.8 Oct 28

In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it

CVE-2012-1823 CRITICAL POC
9.8 May 11

sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2018-11138 CRITICAL POC
9.8 May 31

The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy