CVE-2019-16168
Medium · 6.5CVSS
6.5
EPSS
4.2%
Published
Sep 9, 2019
CISA due date
—
Cloudanix analysis
A flaw in a common database library can make applications using it crash when they open specially crafted data files, interrupting service until restarted.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Library
- Class
- Improper Input Validation
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Missing validation of the sqlite_stat1 sz field in whereLoopAddBtreeIndex allows a crafted database to trigger an integer division by zero in the SQLite query planner, resulting in a crash.
Why it matters to the business
Applications using the vulnerable SQLite version can be forced offline, causing service disruption and potential data access loss until the process restarts; the issue affects widely deployed components in databases and applications.
How an attack unfolds
An attacker supplies a malicious SQLite database containing an invalid sz value in sqlite_stat1; when the victim application opens the database and the query planner executes whereLoopAddBtreeIndex, the division by zero occurs and crashes the process.
How to fix it
Upgrade the affected SQLite library to a version beyond 3.29.0; for GitLab (Bitnami) deployments, update to version 14.3.6 or later that bundles a corrected SQLite release.
How to confirm the fix worked
Confirm the running SQLite version is newer than 3.29.0; test by opening a crafted database containing an invalid sqlite_stat1 sz value and verify the query planner no longer crashes.
Typical attack path
- Obtain or craft a SQLite database file with manipulated sqlite_stat1 sz field
- Deliver the file to the target application (e.g., via upload, download, or embedded resource)
- Trigger database open or query operations that invoke the query planner
- Induce division-by-zero crash in whereLoopAddBtreeIndex
How to detect it
Review application and system logs for SQLite-related crashes mentioning query planner, whereLoopAddBtreeIndex, or division by zero; correlate with file-open events involving untrusted SQLite databases.
- whereLoopAddBtreeIndex
- severe division by zero in the query planner
- sqlite_stat1 sz
What your security team should do
- Immediately inventory all applications and containers using SQLite 3.29.0 or earlier
- Apply the documented fixed versions (GitLab Bitnami 14.3.6) within change windows
- Add SQLite version checks to build and deployment pipelines
- Monitor crash logs for division-by-zero or query-planner failures until patches are deployed
The record
In SQLite through 3.29.0, whereLoopAddBtreeIndex in sqlite3.c can crash a browser or other application because of missing validation of a sqlite_stat1 sz field, aka a "severe division by zero in the query planner."
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| AlmaLinux:8 | mingw-binutils-generic | 0 | 2.30-3.el8 |
| AlmaLinux:8 | mingw-filesystem-base | 0 | 104-2.el8 |
| AlmaLinux:8 | mingw32-binutils | 0 | 2.30-3.el8 |
| AlmaLinux:8 | mingw32-bzip2 | 0 | 1.0.6-14.el8 |
| AlmaLinux:8 | mingw32-bzip2-static | 0 | 1.0.6-14.el8 |
| AlmaLinux:8 | mingw32-filesystem | 0 | 104-2.el8 |
| AlmaLinux:8 | mingw32-sqlite | 0 | 3.26.0.0-1.el8 |
| AlmaLinux:8 | mingw32-sqlite-static | 0 | 3.26.0.0-1.el8 |
| AlmaLinux:8 | mingw64-binutils | 0 | 2.30-3.el8 |
| AlmaLinux:8 | mingw64-bzip2 | 0 | 1.0.6-14.el8 |
| AlmaLinux:8 | mingw64-bzip2-static | 0 | 1.0.6-14.el8 |
| AlmaLinux:8 | mingw64-filesystem | 0 | 104-2.el8 |
| AlmaLinux:8 | mingw64-sqlite | 0 | 3.26.0.0-1.el8 |
| AlmaLinux:8 | mingw64-sqlite-static | 0 | 3.26.0.0-1.el8 |
| Alpine:v3.10 | sqlite | 0 | 3.28.0-r1 |
| Alpine:v3.8 | sqlite | 0 | 3.25.3-r2 |
| Alpine:v3.9 | sqlite | 0 | 3.28.0-r1 |
| Chainguard | mysql-8.0 | 0 | 8.0.38-r0 |
| Chainguard | mysql-8.0-bitnami-compat | 0 | 8.0.38-r0 |
| Chainguard | mysql-8.0-client | 0 | 8.0.38-r0 |
| Chainguard | mysql-8.0-dev | 0 | 8.0.38-r0 |
| Chainguard | mysql-8.0-iamguarded-compat | 0 | 8.0.38-r0 |
| Chainguard | mysql-8.0-oci-entrypoint | 0 | 8.0.38-r0 |
| Chainguard | mysql-8.0-oci-entrypoint-compat | 0 | 8.0.38-r0 |
| Debian:11 | sqlite3 | 0 | 3.29.0-2 |
| Debian:12 | sqlite3 | 0 | 3.29.0-2 |
| Debian:13 | sqlite3 | 0 | 3.29.0-2 |
| Debian:9 | sqlite3 | 0 | 3.16.2-5+deb9u2 |
| Mageia:7 | sqlite3 | 0 | 3.31.1-1.mga7 |
| Red Hat:enterprise_linux:8::appstream | lemon | 0 | 0:3.26.0-11.el8 |
| Red Hat:enterprise_linux:8::appstream | lemon-debuginfo | 0 | 0:3.26.0-11.el8 |
| Red Hat:enterprise_linux:8::appstream | sqlite | 0 | 0:3.26.0-11.el8 |
| Red Hat:enterprise_linux:8::appstream | sqlite-analyzer-debuginfo | 0 | 0:3.26.0-11.el8 |
| Red Hat:enterprise_linux:8::appstream | sqlite-debuginfo | 0 | 0:3.26.0-11.el8 |
| Red Hat:enterprise_linux:8::appstream | sqlite-debugsource | 0 | 0:3.26.0-11.el8 |
| Red Hat:enterprise_linux:8::appstream | sqlite-devel | 0 | 0:3.26.0-11.el8 |
| Red Hat:enterprise_linux:8::appstream | sqlite-doc | 0 | 0:3.26.0-11.el8 |
| Red Hat:enterprise_linux:8::appstream | sqlite-libs | 0 | 0:3.26.0-11.el8 |
| Red Hat:enterprise_linux:8::appstream | sqlite-libs-debuginfo | 0 | 0:3.26.0-11.el8 |
| Red Hat:enterprise_linux:8::appstream | sqlite-tcl-debuginfo | 0 | 0:3.26.0-11.el8 |
| Red Hat:enterprise_linux:8::baseos | lemon | 0 | 0:3.26.0-11.el8 |
| Red Hat:enterprise_linux:8::baseos | lemon-debuginfo | 0 | 0:3.26.0-11.el8 |
| Red Hat:enterprise_linux:8::baseos | sqlite | 0 | 0:3.26.0-11.el8 |
| Red Hat:enterprise_linux:8::baseos | sqlite-analyzer-debuginfo | 0 | 0:3.26.0-11.el8 |
| Red Hat:enterprise_linux:8::baseos | sqlite-debuginfo | 0 | 0:3.26.0-11.el8 |
| Red Hat:enterprise_linux:8::baseos | sqlite-debugsource | 0 | 0:3.26.0-11.el8 |
| Red Hat:enterprise_linux:8::baseos | sqlite-devel | 0 | 0:3.26.0-11.el8 |
| Red Hat:enterprise_linux:8::baseos | sqlite-doc | 0 | 0:3.26.0-11.el8 |
| Red Hat:enterprise_linux:8::baseos | sqlite-libs | 0 | 0:3.26.0-11.el8 |
| Red Hat:enterprise_linux:8::baseos | sqlite-libs-debuginfo | 0 | 0:3.26.0-11.el8 |
| Red Hat:enterprise_linux:8::baseos | sqlite-tcl-debuginfo | 0 | 0:3.26.0-11.el8 |
| Red Hat:enterprise_linux:8::crb | mingw-binutils | 0 | 0:2.30-3.el8 |
| Red Hat:enterprise_linux:8::crb | mingw-binutils-debuginfo | 0 | 0:2.30-3.el8 |
| Red Hat:enterprise_linux:8::crb | mingw-binutils-debugsource | 0 | 0:2.30-3.el8 |
| Red Hat:enterprise_linux:8::crb | mingw-binutils-generic | 0 | 0:2.30-3.el8 |
| Red Hat:enterprise_linux:8::crb | mingw-binutils-generic-debuginfo | 0 | 0:2.30-3.el8 |
| Red Hat:enterprise_linux:8::crb | mingw-bzip2 | 0 | 0:1.0.6-14.el8 |
| Red Hat:enterprise_linux:8::crb | mingw-filesystem | 0 | 0:104-2.el8 |
| Red Hat:enterprise_linux:8::crb | mingw-filesystem-base | 0 | 0:104-2.el8 |
| Red Hat:enterprise_linux:8::crb | mingw-sqlite | 0 | 0:3.26.0.0-1.el8 |
| Red Hat:enterprise_linux:8::crb | mingw32-binutils | 0 | 0:2.30-3.el8 |
| Red Hat:enterprise_linux:8::crb | mingw32-binutils-debuginfo | 0 | 0:2.30-3.el8 |
| Red Hat:enterprise_linux:8::crb | mingw32-bzip2 | 0 | 0:1.0.6-14.el8 |
| Red Hat:enterprise_linux:8::crb | mingw32-bzip2-debuginfo | 0 | 0:1.0.6-14.el8 |
| Red Hat:enterprise_linux:8::crb | mingw32-bzip2-static | 0 | 0:1.0.6-14.el8 |
| Red Hat:enterprise_linux:8::crb | mingw32-filesystem | 0 | 0:104-2.el8 |
| Red Hat:enterprise_linux:8::crb | mingw32-sqlite | 0 | 0:3.26.0.0-1.el8 |
| Red Hat:enterprise_linux:8::crb | mingw32-sqlite-debuginfo | 0 | 0:3.26.0.0-1.el8 |
| Red Hat:enterprise_linux:8::crb | mingw32-sqlite-static | 0 | 0:3.26.0.0-1.el8 |
| Red Hat:enterprise_linux:8::crb | mingw64-binutils | 0 | 0:2.30-3.el8 |
| Red Hat:enterprise_linux:8::crb | mingw64-binutils-debuginfo | 0 | 0:2.30-3.el8 |
| Red Hat:enterprise_linux:8::crb | mingw64-bzip2 | 0 | 0:1.0.6-14.el8 |
| Red Hat:enterprise_linux:8::crb | mingw64-bzip2-debuginfo | 0 | 0:1.0.6-14.el8 |
| Red Hat:enterprise_linux:8::crb | mingw64-bzip2-static | 0 | 0:1.0.6-14.el8 |
| Red Hat:enterprise_linux:8::crb | mingw64-filesystem | 0 | 0:104-2.el8 |
| Red Hat:enterprise_linux:8::crb | mingw64-sqlite | 0 | 0:3.26.0.0-1.el8 |
| Red Hat:enterprise_linux:8::crb | mingw64-sqlite-debuginfo | 0 | 0:3.26.0.0-1.el8 |
| Red Hat:enterprise_linux:8::crb | mingw64-sqlite-static | 0 | 0:3.26.0.0-1.el8 |
| SUSE:HPE Helion OpenStack 8 | sqlite3 | 0 | 3.36.0-9.18.1 |
| SUSE:Linux Enterprise Desktop 12 SP4 | sqlite3 | 0 | 3.8.10.2-9.12.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 | sqlite3 | 0 | 3.28.0-3.9.2 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP1 | sqlite3 | 0 | 3.28.0-3.9.2 |
| SUSE:Linux Enterprise Server 12 SP2-BCL | sqlite3 | 0 | 3.36.0-9.18.1 |
| SUSE:Linux Enterprise Server 12 SP3-BCL | sqlite3 | 0 | 3.36.0-9.18.1 |
| SUSE:Linux Enterprise Server 12 SP3-LTSS | sqlite3 | 0 | 3.36.0-9.18.1 |
| SUSE:Linux Enterprise Server 12 SP4 | sqlite3 | 0 | 3.8.10.2-9.12.1 |
| SUSE:Linux Enterprise Server 12 SP4-LTSS | sqlite3 | 0 | 3.36.0-9.18.1 |
| SUSE:Linux Enterprise Server 12 SP5 | sqlite3 | 0 | 3.36.0-9.18.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP3 | sqlite3 | 0 | 3.36.0-9.18.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP4 | sqlite3 | 0 | 3.8.10.2-9.12.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP4 | sqlite3 | 0 | 3.36.0-9.18.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | sqlite3 | 0 | 3.36.0-9.18.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP4 | sqlite3 | 0 | 3.8.10.2-9.12.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP5 | sqlite3 | 0 | 3.36.0-9.18.1 |
| SUSE:OpenStack Cloud 8 | sqlite3 | 0 | 3.36.0-9.18.1 |
| SUSE:OpenStack Cloud 9 | sqlite3 | 0 | 3.36.0-9.18.1 |
| SUSE:OpenStack Cloud Crowbar 8 | sqlite3 | 0 | 3.36.0-9.18.1 |
| SUSE:OpenStack Cloud Crowbar 9 | sqlite3 | 0 | 3.36.0-9.18.1 |
| Ubuntu:16.04:LTS | sqlite3 | 0 | 3.11.0-1ubuntu1.3 |
| Ubuntu:18.04:LTS | sqlite3 | 0 | 3.22.0-1ubuntu0.2 |
| openSUSE:Leap 15.0 | sqlite3 | 0 | 3.28.0-lp150.2.9.1 |
| openSUSE:Leap 15.1 | sqlite3 | 0 | 3.28.0-lp151.2.3.1 |
| openSUSE:Tumbleweed | sqlite3 | 0 | 3.36.0-1.2 |
Related vulnerabilities
- CVE-2020-13632 ext/fts3/fts3_snippet.c in SQLite before 3.32.0 has a NULL pointer dereference via a… Also affects mingw-binutils-generic
- CVE-2020-13631 SQLite before 3.32.0 allows a virtual table to be renamed to the name of one of its… Also affects mingw-binutils-generic
- CVE-2020-13630 ext/fts3/fts3.c in SQLite before 3.32.0 has a use-after-free in fts3EvalNextRow, related… Also affects mingw-binutils-generic
- CVE-2025-6965 There exists a vulnerability in SQLite versions before 3.50.2 where the number of… Also affects mingw32-sqlite
- CVE-2020-11655 SQLite through 3.31.1 allows attackers to cause a denial of service (segmentation fault)… Also affects sqlite
- CVE-2019-19242 SQLite 3.30.1 mishandles pExpr->y.pTab, as demonstrated by the TK_COLUMN case in… Also affects sqlite
- CVE-2019-19244 sqlite3Select in select.c in SQLite 3.30.1 allows a crash if a sub-select uses both… Also affects sqlite
- CVE-2019-8457 SQLite3 from 3.6.0 to and including 3.27.2 is vulnerable to heap out-of-bound read in the… Also affects sqlite