Critical (9.9)

Electric SQL injection destroys database (CVE-2026-40906)

CVE-2026-40906

CVE-2026-40906 is a critical SQL injection in Electric versions 1.1.12-1.4.x letting any authenticated user read, write, or delete all database data. Upgrade to version 1.5.0 now.

Patch now - CVE-2026-40906 is a critical SQL injection in Electric versions 1.1.12 through 1.4.x that grants any authenticated user complete control over the PostgreSQL database, including the ability to read credentials, write backdoor accounts, and delete tables. Upgrade to version 1.5.0 immediately.

Overview

Electric is a Postgres sync engine that provides real-time data synchronization for web applications. A critical vulnerability in the /v1/shape API allows any authenticated user to execute arbitrary SQL commands against the underlying PostgreSQL database through a crafted order_by parameter. The issue affects versions 1.1.12 through 1.4.x and is fixed in version 1.5.0.

Vulnerability Details

The vulnerability exists in the order_by parameter of the /v1/shape API endpoint. Because this parameter is directly concatenated into SQL queries without proper sanitization, an attacker can inject malicious ORDER BY expressions. This error-based SQL injection technique works even when the attacker has only low-level authentication privileges.

Impact

An attacker exploiting CVE-2026-40906 can:

  • Read all data from the PostgreSQL database, including user credentials and sensitive business data
  • Write arbitrary data into database tables, including malicious content or backdoor accounts
  • Delete entire tables or databases, causing permanent data loss
  • Potentially execute operating system commands if the PostgreSQL user has sufficient permissions (e.g., the superuser role)

The CVSS 9.9 rating reflects the network-based attack vector, low complexity, low privilege requirements, and complete loss of confidentiality, integrity, and availability.

Affected Versions

Electric versions 1.1.12 through 1.4.x are vulnerable. Version 1.5.0 contains the fix.

Remediation

Upgrade to Electric version 1.5.0 or later immediately. For deployments using containerized Electric, pull the latest image with docker pull electric:1.5.0.

If immediate upgrade is not possible, implement the following mitigations:

  • Restrict access to the /v1/shape API endpoint to trusted IP addresses only
  • Review all authenticated users and remove unnecessary accounts
  • Monitor database logs for suspicious ORDER BY patterns

No workaround fully eliminates the risk; upgrading is the only complete fix.

Security Insight

This vulnerability illustrates a recurring pattern in modern sync engines: exposing raw database query parameters through REST APIs creates dangerous injection surfaces. Similar SQL injection flaws in GraphQL engines and database synchronization tools have led to major breaches. Electric’s architecture, which grants authenticated users direct database access through the shape API, demands exceptionally careful input validation. Organizations using database sync tools should audit all API endpoints that accept user-controlled SQL fragments and implement parameterized queries at the application layer.

For the latest data breach reports, visit breach reports. For cybersecurity news and updates, see security news.

Further Reading

Share:

Never miss a critical vulnerability

Get real-time security alerts delivered to your preferred platform.

Related Advisories

Related Across Yazoul

Never Miss a Critical Alert

CVE advisories, breach reports, and threat intel — delivered daily to your inbox.