Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-51936 Overview
CVE-2026-51936 is a SQL injection vulnerability [CWE-89] in Zetetic SQLCipher versions before 4.15.0. The flaw resides in the sqlcipher_export convenience function, which copies contents between attached databases and is commonly used to convert between plaintext and encrypted stores. Because sqlcipher_export performs dynamic schema manipulation, it temporarily clears defensive restrictions during operation. Improper handling of the source database name parameter allows a caller to supply a crafted name that executes statements defensive mode would normally block. Successful exploitation permits direct modification of the sqlite_schema table and can lead to database corruption.
Critical Impact
A local caller with the ability to invoke sqlcipher_export can bypass SQLCipher defensive mode, tamper with sqlite_schema, and corrupt the target database.
Affected Products
- Zetetic SQLCipher versions prior to 4.15.0
- Applications embedding vulnerable SQLCipher builds for database encryption
- Downstream language bindings that expose the sqlcipher_export function
Discovery Timeline
- 2026-09-30 - CVE-2026-51936 published to NVD
- 2026-09-30 - Last updated in NVD database
Technical Details for CVE-2026-51936
Vulnerability Analysis
The sqlcipher_export function copies schema and data from a source attached database into a target database. To perform this operation, it must issue dynamic SQL that references the source and target schema names, and it lifts defensive restrictions such as writes to sqlite_schema for the duration of the copy.
Before 4.15.0, the source database name argument was interpolated into the generated SQL without strict validation. A caller controlling that argument could inject additional SQL statements that execute inside the relaxed defensive context. This transforms a benign export helper into a primitive for arbitrary schema manipulation on the attached database.
Root Cause
The root cause is missing input validation on the source database identifier passed to sqlcipher_exportFunc in src/sqlcipher.c. The function trusted the string as a schema name and used it in constructed SQL while defensive checks were suspended. This combination of dynamic SQL construction and a temporarily lowered security boundary made SQL injection possible.
Attack Vector
Exploitation requires local access to an application that exposes sqlcipher_export with an attacker-influenced source database name. The attacker supplies a crafted identifier containing embedded SQL, which executes with the ability to modify sqlite_schema. Impact is limited to the database being exported to, but can include schema tampering and corruption of stored data.
// Security patch in src/sqlcipher.c - sanitize source database name
static void sqlcipher_exportFunc(sqlite3_context *context, int argc, sqlite3_value **argv) {
sqlite3 *db = sqlite3_context_db_handle(context);
const char* targetDb, *sourceDb;
- int targetDb_idx = 0;
+ int targetDb_idx = 0, sourceDb_idx = 0;
u64 saved_flags = db->flags; /* Saved value of the db->flags */
u32 saved_mDbFlags = db->mDbFlags; /* Saved value of the db->mDbFlags */
int saved_nChange = db->nChange; /* Saved value of db->nChange */
// Source: https://github.com/sqlcipher/sqlcipher/commit/30842cda35c88cdfc7a8adba1c9b20821d2c08d1
The patch introduces a tracked sourceDb_idx so the source name is validated against the list of attached databases rather than being interpolated as an untrusted string. See the GitHub SQLCipher commit for the full fix.
Detection Methods for CVE-2026-51936
Indicators of Compromise
- Unexpected rows or modifications in the sqlite_schema table of databases that use SQLCipher
- Application logs showing calls to sqlcipher_export with unusual or attacker-controlled source database identifiers
- Database integrity check failures (PRAGMA integrity_check) on encrypted stores exported by older SQLCipher builds
Detection Strategies
- Inventory applications that link against SQLCipher and identify builds older than 4.15.0
- Audit source code for call sites that pass user-controlled input as the source database name to sqlcipher_export
- Review query logs for SELECT sqlcipher_export(...) invocations containing quoting characters or semicolons in the source name argument
Monitoring Recommendations
- Enable and monitor SQL query logging in applications that expose sqlcipher_export to non-privileged code paths
- Alert on runtime SQLite errors referencing sqlite_schema or malformed database structures on hosts running SQLCipher-backed applications
- Track file integrity of SQLCipher-managed database files to detect unexpected schema-level changes
How to Mitigate CVE-2026-51936
Immediate Actions Required
- Upgrade all instances of SQLCipher to version 4.15.0 or later, which strictly validates the source database name
- Identify and refactor application code that passes untrusted input as the source database argument to sqlcipher_export
- Rebuild and redistribute dependent applications and language bindings that statically embed the SQLCipher library
Patch Information
Zetetic released SQLCipher 4.15.0 with strict validation of the source database name in sqlcipher_exportFunc, preventing the defensive-mode bypass. Details are available in the Zetetic SQLCipher 4.15.0 release notes and the upstream GitHub SQLCipher commit.
Workarounds
- Restrict exposure of sqlcipher_export to trusted, application-controlled code paths only
- Validate source database identifiers against an allowlist of attached schema names before invoking the function
- Avoid constructing sqlcipher_export calls from any input derived from user data, IPC messages, or external configuration
# Verify installed SQLCipher version and confirm it is 4.15.0 or later
sqlcipher :memory: "PRAGMA cipher_version;"
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

