Severity by source
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
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.
Primary rating from NVD.
CVSS VectorNVD
Lifecycle Timeline
10DescriptionNVD
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.
AnalysisAI
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.
Technical ContextAI
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.
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.
More in PostgreSQL
View allPostgreSQL libpq functions PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn() improperl
An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl
Argument injection vulnerability in PostgreSQL 9.2.x before 9.2.4, 9.1.x before 9.1.9, and 9.0.x before 9.0.13 allows re
Unauthenticated arbitrary file write in Splunk Enterprise (below 10.2.4 and 10.0.7) and Splunk Cloud Platform (below 10.
Unauthenticated SQL injection in Sangoma Switchvox SMB Edition 8.3 (build 104997) lets remote attackers execute arbitrar
PostgreSQL versions before 9.2.22, 9.3.18, 9.4.13, 9.5.8 and 9.6.4 are vulnerable to incorrect authentication flaw allow
The build_tablename function in pgsql.c in the PostgreSQL (aka pgsql) extension in PHP through 5.6.7 does not validate t
A vulnerability in the h2oai/h2o-3 REST API versions 3.46.0.4 allows unauthenticated remote attackers to execute arbitra
In PostgreSQL 9.3 through 11.2, the "COPY TO/FROM PROGRAM" function allows superusers and users in the 'pg_execute_serve
Unauthenticated SQL injection in Vendure Shop API allows remote attackers to execute arbitrary SQL commands against the
Parse Server is an open source http web server backend. Rated critical severity (CVSS 10.0), this vulnerability is remot
Hard-coded default PostgreSQL credentials shipped in the docker-compose.yaml of langgenius Dify through version 1.5.1 al
Same weakness CWE-89 – SQL Injection
View allVendor StatusVendor
Share
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-24475