---
id: "CVE-2026-119591"
kind: "vulnerability"
aliases: ["CVE-2026-119591"]
title: "SQLite: deep expression nesting in count(*) exhausts the stack, crashing the process"
severity: "medium"
cvss: 6.8
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["embedded-db", "mobile", "node", "package", "python", "sqlite"]
not_affected_if: ["sqlite-3.54.0-or-later", "trusted-sql-only"]
published_at: "2026-10-30T12:16:44+00:00"
first_seen_at: "2026-10-30T12:30:27+00:00"
updated_at: "2026-10-30T12:32:30+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-119591", "first_seen_at": "2026-10-30T12:30:27+00:00"}]
---

# SQLite: deep expression nesting in count(*) exhausts the stack, crashing the process

SQLite versions before 3.54.0 contain a stack exhaustion bug in countOfViewOptimization(). A crafted query over a large multi-row VALUES clause, or a database file with a crafted view, can crash the host process, causing denial of service.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Run `sqlite3 --version` or check the bundled SQLite version in your application's dependencies
- Search your dependency lockfiles for SQLite versions below `3.54.0`

## Fix

- SQLite: move to `3.54.0` or later

## Timeline

- 2026-10-30T12:30:27+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-119591

## From the sources

SQLite before 3.54.0 contains a stack exhaustion vulnerability in countOfViewOptimization() that allows attackers to crash the host process via count(*) over a large multi-row VALUES clause. Attackers supplying SQL or a database file with a crafted view can trigger deeply nested TK_PLUS expressions whose recursive freeing in sqlite3ExprDeleteNN() exhausts the C stack, causing denial of service.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
