ElectricSQL /v1/shape API SQL Injection Vulnerability
The ElectricSQL sync engine is vulnerable to SQL injection, potentially allowing authenticated users to read, write, and destroy the underlying PostgreSQL database.
Electric, a Postgres sync engine, is vulnerable to SQL injection in the order_by parameter of the ElectricSQL /v1/shape API endpoint. This vulnerability exists in versions 1.1.12 to before 1.5.0. Exploitation allows any authenticated user to execute arbitrary SQL queries, leading to potential data breaches, data manipulation, and complete database compromise. Successful exploitation can result in unauthorized access to sensitive information, modification of critical data, and denial of service. Organizations using vulnerable versions of ElectricSQL are at high risk. The vulnerability is resolved in version 1.5.0.
Attack Chain
- An attacker authenticates to the ElectricSQL application.
- The attacker crafts a malicious HTTP request targeting the
/v1/shapeAPI endpoint. - The crafted request includes a SQL injection payload within the
order_byparameter. - The ElectricSQL application processes the request without proper sanitization of the
order_byparameter. - The malicious SQL payload is executed against the underlying PostgreSQL database.
- The attacker leverages the SQL injection vulnerability to extract sensitive data, such as user credentials or proprietary information, using
SELECTstatements. - The attacker escalates privileges by manipulating database objects or creating new administrative accounts using
CREATEandALTERstatements. - The attacker destroys data or renders the database unavailable using
DELETEandDROPstatements, achieving complete system compromise.
Impact
Successful exploitation of this SQL injection vulnerability could lead to a complete compromise of the underlying PostgreSQL database. This may result in unauthorized access to sensitive data, including customer information, financial records, and intellectual property. Attackers could also modify or delete data, leading to data loss, service disruption, and reputational damage. Given the potential for complete data destruction, organizations are urged to remediate this vulnerability immediately.
Recommendation
- Upgrade ElectricSQL to version 1.5.0 or later to patch the vulnerability (CVE-2026-40906).
- Implement input validation and sanitization for all user-supplied data, especially in the
order_byparameter of the/v1/shapeAPI. - Monitor web server logs for suspicious activity, such as unusual characters or SQL keywords in the
order_byparameter of requests to the/v1/shapeAPI to enable the “Detect Suspicious SQL Injection Attempt in ElectricSQL API Request” rule. - Deploy the Sigma rule “Detect Suspicious SQL Injection Error Messages” to identify potential exploitation attempts based on error responses from the database server.
Detection coverage 2
Detect Suspicious SQL Injection Attempt in ElectricSQL API Request
highDetects potential SQL injection attempts targeting the ElectricSQL /v1/shape API by looking for specific SQL keywords in the order_by parameter.
Detect Suspicious SQL Injection Error Messages
mediumDetects potential SQL injection exploitation by identifying common SQL error messages in server responses.
Detection queries are kept inside the platform. Get full rules →