Cross-site Scripting (XSS)Weakness · CWE-79

CVE-2026-42877

MEDIUM · 5.4 CVSS v3.1 Published 2026-05-27
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
58/100
Remediation priority · Elevated
Remotely reachable

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
FacturaScripts is an open source accounting and invoicing software. In 2025.92 and earlier, a stored Cross-Site Scripting (XSS) vulnerability exists in the product search modal of sales (Core/Lib/AjaxForms/SalesModalHTML.php) and purchases documents (Core/Lib/AjaxForms/PurchasesModalHTML.php). 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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

A stored Cross-Site Scripting vulnerability in FacturaScripts allows authenticated users with warehouse module access to inject malicious JavaScript through product reference fields. The payload persists in the database and executes in other users' browsers when they access the product search modal within sales or purchases documents (invoices, orders, delivery notes).

MitigationImplement strict input validation and sanitization for product reference fields on submission, and apply context-aware output encoding when rendering product data in the SalesModalHTML.php and PurchasesModalHTML.php modals.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
Low
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify FacturaScripts installation
    Locate the FacturaScripts installation directory and check for the presence of core files such as 'facturascripts.ini' or the main index.php. Check the application version by examining the version file or the admin panel if accessible.
    Affected if FacturaScripts is not installed or the version is not within the affected range (if a version range is later defined).
  2. Verify warehouse module status
    Log into FacturaScripts as an administrator and navigate to the 'Modules' or 'Plugins' section. Check whether the Warehouse module is installed and enabled.
    Affected if The Warehouse module is enabled and active in the installation.
  3. Check user warehouse access permissions
    Navigate to Users > [Select User] > Permissions in the admin panel. Examine whether any user account has 'warehouse' or 'almacén' module permissions granted.
    Affected if At least one authenticated user has warehouse module access.
  4. Inspect product reference data in database
    Access the FacturaScripts database (typically MySQL or PostgreSQL). Query the products table (commonly 'productos' or similar) and examine the 'referencia' or 'reference' column for any suspicious patterns such as <script>, javascript:, onload, onerror, or other HTML/JavaScript tags.
    Affected if The 'referencia' field in any product record contains unescaped HTML or JavaScript code.
  5. Verify modal rendering code for output encoding
    Locate the files SalesModalHTML.php and PurchasesModalHTML.php in the FacturaScripts directory. Inspect how they handle and display the product reference field - check if htmlspecialchars() or equivalent encoding is applied when rendering the reference in the product search modal.
    Affected if The modal files render product reference data without proper output encoding, allowing stored XSS to execute.

A user is affected if they have FacturaScripts with the warehouse module enabled, at least one user has warehouse access permissions, and malicious JavaScript payloads exist in the product reference field that render unescaped in the sales or purchases modal views.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Implement strict input validation and sanitization for product reference fields on submission, and apply context-aware output encoding when rendering product data in the SalesModalHTML.php and PurchasesModalHTML.php modals.

Recommended fix Moderate confidence

FacturaScripts 2025.93 or later stable release

  1. 1. Identify the current FacturaScripts version by checking the admin panel or the version.php file
  2. 2. If running version 2025.92 or earlier, plan an upgrade to the latest stable release
  3. 3. Before upgrading, backup the database and all application files
  4. 4. Review the upgrade documentation specific to FacturaScripts for your deployment method
  5. 5. Perform the upgrade following official upgrade procedures
  6. 6. After upgrade, verify that the product search modal in Sales > Invoices, Orders, and Delivery Notes properly sanitizes product references
  7. 7. Test by creating a product with potential XSS characters in the reference field and confirming they are properly escaped when displayed in the modal
Caveat Review release notes between your current version and 2025.93+ for any breaking changes in plugin compatibility or database schema modifications

Generated from the published advisory — verify against the referenced sources before acting.

Have this fixed Scoped from the published advisory
  • Consultation3.0 h
  • Implementation6.0 h
  • Testing3.0 h
  • Review / QA2.0 h
14.0 hours of engineering $2,490
Get help mitigating

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $3,984.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2026-42877 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2026-42877 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data