Skip to main content

ElectricSQL CVE-2026-40906

| EUVDEUVD-2026-24475 HIGH
SQL Injection (CWE-89)
2026-04-21 GitHub_M
8.8
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Obtain authenticated shape API access
  2. Delivery
    Send /v1/shape request with crafted order_by
  3. Exploit
    Inject subquery/cast into ORDER BY clause
  4. Execution
    Trigger error-based SQL execution in PostgreSQL
  5. Impact
    Read, modify, or destroy database contents

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Parameterized queries, prepared statements
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Persistence

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

The attacker must be an authenticated user of the ElectricSQL /v1/shape API (CVSS PR:L) and the deployment must run an affected version (1.1.12 to before 1.5.0). The concrete trigger is supplying a crafted value in the shape request's order_by/subset parameter containing disallowed constructs - subqueries, type casts (::), or function calls - which the pre-1.5.0 AST validator failed to reject. Limiting factors: valid API credentials are required (no unauthenticated path), so risk scales with how broadly and to how untrusted a population API access is granted; there is no user-interaction requirement (UI:N), and the vector is network-remote (AV:N) with low complexity (AC:L). No special non-default configuration is needed beyond exposing the shape API with order_by to the authenticated user.

Impact

Signals conflict instructively. CVSS is 8.8 (High) with AV:N/AC:L/PR:L/UI:N and total C/I/A impact, and SSVC rates Technical Impact as 'total' - consistent with full database compromise. However SSVC also marks Exploitation as 'none' and Automatable as 'no', and EPSS is only 0.03% (9th percentile), indicating no observed exploitation and low predicted near-term volume. The gating factor is PR:L: the attacker must already be an authenticated shape-API user, so exposure is bounded by who can obtain valid API credentials in a given deployment. This is a genuine high-impact injection worth prompt patching wherever untrusted or low-trust users hold API access, but it is not a mass-exploitable internet-wide emergency: the low EPSS and 'not automatable' rating point to targeted rather than opportunistic risk. Absence from CISA KEV and no public exploit further temper urgency relative to the raw CVSS number.

Exploit ScenarioDerived

An authenticated but low-privilege user of an application built on Electric calls the /v1/shape API with a malicious order_by value such as 'CAST((SELECT version()) AS int) DESC' or 'CAST((SELECT string_agg(table_name, ',') FROM information_schema.tables) AS int) DESC', using PostgreSQL error messages to exfiltrate data (error-based injection). By escalating to write or DDL payloads the attacker can modify or destroy the underlying database. The vendor's own regression tests demonstrate these payload classes (subqueries, casts, pg_sleep, information_schema enumeration); no separate public exploit has been identified.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 24, 2026

Authenticated SQL injection in ElectricSQL's Electric Postgres sync engine (1.1.12 up to before 1.5.0) lets any authenticated user of the /v1/shape API smuggle arbitrary SQL through the order_by parameter. Because the shape layer forwarded the user-supplied ORDER BY string into a query with only permissive validation, crafted ORDER BY expressions (subqueries, casts, function calls) achieve error-based injection with full read, write, and destroy access to the backing PostgreSQL database. No public exploit identified at time of analysis and EPSS is very low (0.03%), but the fix (1.5.0) and PR diff are public.

RemediationAI

Vendor-released patch: upgrade to Electric 1.5.0, which fixes the ORDER BY validation (PR https://github.com/electric-sql/electric/pull/4081; advisory GHSA-h5rg-pxx7-r2hj) - this is the primary and recommended action. If an immediate upgrade is not possible, reduce exposure by restricting who can reach the /v1/shape API and revoking API access for untrusted or low-trust principals, since exploitation requires an authenticated user (trade-off: may disrupt legitimate low-trust clients relying on shape subsets). Where the order_by capability is not required, reject requests carrying an order_by parameter at a reverse proxy or API gateway (trade-off: breaks clients that legitimately sort). As defense-in-depth, run Electric's PostgreSQL connection under a least-privilege role so a successful injection cannot write or drop beyond that role's grants (trade-off: does not stop reads of accessible data and may require schema/permission changes). Do not treat workarounds as a substitute for the 1.5.0 upgrade.

Affected VersionsENISA

electric 1.1.12, < 1.5.0

Affected Packages

euvd electric_1_1_12 fix: 1.5.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Electric is a sync engine that streams subsets ('shapes') of a PostgreSQL database to clients over its HTTP /v1/shape API. The vulnerable path is in the Elixir sync-service order-by handling: Electric.Replication.Eval.Parser parsed 'SELECT 1 ORDER BY <user input>' with PgQuery and then relied on an AST walker whose catch-all clause (check_valid_refs(_, _, _) -> {:ok, :ok}) permitted any node type it did not explicitly reject, and it forwarded the raw user string downstream rather than a re-serialized safe form. This is a classic CWE-89 (SQL Injection) caused by an allowlist that behaved as a denylist: subqueries, type casts, and function calls in the ORDER BY were accepted. The affected package is cpe:2.3:a:electric-sql:electric, specifically the @core/sync-service component per the changeset. The 1.5.0 fix replaces the permissive catch-all with a deny-by-default allowlist of safe node types (SortBy, Node, String, A_Const, Array) and rebuilds the clause from the validated AST via PgQuery deparse (protobuf_to_query) instead of trusting the raw input.

Know when Electric gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

NVD PRIMARY 8.8 HIGH
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 8.8 HIGH

Network-reachable API with low complexity, but exploitation requires an authenticated shape-API user (PR:L); SQLi yields full read/write/destroy, so C/I/A all High.

3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Red Hat 8.8 HIGH

Primary rating from NVD.

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

7
Severity Changed
Jun 30, 2026 - 03:24 NVD
CRITICAL HIGH
CVSS changed
Jun 30, 2026 - 03:24 NVD
9.9 (CRITICAL) 8.8 (HIGH)
Patch released
Apr 22, 2026 - 21:24 nvd
Patch available
Patch available
Apr 21, 2026 - 22:17 EUVD
CVSS changed
Apr 21, 2026 - 21:22 NVD
10.0 (CRITICAL) 9.9 (CRITICAL)
CVE Published
Apr 21, 2026 - 20:05 nvd
HIGH 8.8
CVE Published
Apr 21, 2026 - 20:05 nvd
CRITICAL 9.9

DescriptionNVD

Electric is a Postgres sync engine. From 1.1.12 to before 1.5.0, the order_by parameter in the ElectricSQL /v1/shape API is vulnerable to error-based SQL injection, allowing any authenticated user to read, write, and destroy the full contents of the underlying PostgreSQL database through crafted ORDER BY expressions. This vulnerability is fixed in 1.5.0.

Executive ViewAI

Why It Matters

ElectricSQL's Electric Postgres sync engine (versions 1.1.12 through 1.4.x) contains an authenticated SQL injection vulnerability in the /v1/shape API that allows attackers with valid database credentials to gain full read, write, and delete access to the backing PostgreSQL database. Organizations using affected versions face data theft, modification, or destruction if the sync API is exposed to multiple users or untrusted applications. A patch (version 1.5.0) is available and should be deployed immediately.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.0%
Top 91% exploitable
Prevalence
Low
niche open-source Postgres sync engine, limited enterprise footprint
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy