Severity by source
AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
Primary rating from GitHub Advisory · only source for this CVE.
CVSS VectorGitHub Advisory
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
Lifecycle Timeline
3DescriptionGitHub Advisory
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.phpCore/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:
// SalesModalHTML.php ~line 102
$tbody .= '<tr onclick="return salesFormAction(\'add-product\', \''
. $row['referencia'] // no htmlspecialchars() applied
. '\');">';When a product is saved, noHtml() encodes ' → '. 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:
// SalesDocument.html.twig line 118
document.getElementById("findProductList").innerHTML = data.products;The browser HTML parser decodes ' → ' 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'+alert(1)+'
Resulting onclick after innerHTML decode:
return salesFormAction('add-product', 'x'+alert(1)+'')
// ^^^^^^^^^^ executes before the function callSteps to reproduce
Step 1 - Inject the payload
- Log in as a user with write access to Warehouse → Products
- Navigate to
/EditProductoand create a new product with the following values:
| Field | Value |
|---|---|
| Reference | x'+alert(1)+' |
| Description | test |
- Save the product
Step 2 - Trigger the XSS
- Make sure at least one customer exists in the system (Sales → Customers)
- Navigate to
/EditFacturaCliente?codcliente=<customer_code> - In the invoice form, click the product search button next to the "Referencia" field
- 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
// 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 ' and - critically - remains ' 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
AnalysisAI
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.
Technical ContextAI
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.
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.
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
(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear
ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C
Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au
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
Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
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
The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1
NetAlertX (formerly PiAlert) versions 23.01.14 through 24.x before 24.10.12 allow unauthenticated command injection thro
The GiveWP - Donation Plugin and Fundraising Platform plugin for WordPress is vulnerable to PHP Object Injection in all
Same weakness CWE-79 – Cross-site Scripting (XSS)
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-32630
GHSA-r736-2678-fcrx