---
id: "CVE-2026-119371"
kind: "vulnerability"
aliases: ["CVE-2026-119371"]
title: "SQLite: deep CTE chains exhaust the stack and crash the process"
severity: "medium"
cvss: 6.8
epss: null
exploited: false
status: "open"
category: "runtime"
products: []
ecosystems: []
tags: ["embedded-databases", "node", "python", "runtime", "sqlite"]
not_affected_if: ["sqlite-3.54.0-or-later", "trusted-queries-only"]
published_at: "2026-10-30T12:16:35+00:00"
first_seen_at: "2026-10-30T12:30:23+00:00"
updated_at: "2026-10-30T12:32:38+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-119371", "first_seen_at": "2026-10-30T12:30:23+00:00"}]
---

# SQLite: deep CTE chains exhaust the stack and crash the process

SQLite before 3.54.0 does not count common table expressions against its expression nesting limit, so a WITH clause with tens of thousands of CTEs makes the query planner recurse until the process crashes. An attacker who can supply SQL or open an untrusted database file with a crafted view can cause a 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
- Look for any code that runs queries from untrusted sources or opens database files from outside your control

## Fix

- SQLite versions before `3.54.0` are affected; move to `3.54.0` or later

## Timeline

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

## From the sources

SQLite before 3.54.0 contains a stack exhaustion vulnerability that allows attackers to bypass the SQLITE_LIMIT_EXPR_DEPTH nesting limit because common table expressions are not counted against it. Attackers can supply a WITH clause chaining tens of thousands of CTEs, via plain SQL or a view in an untrusted database file, causing unbounded selectExpander() recursion that crashes the process.

---

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