Bug 2552464 - sqlite: sqlite: stack overflow via VALUES clause with WITH and UNION ALL fallback
Summary: sqlite: sqlite: stack overflow via VALUES clause with WITH and UNION ALL fall...
Keywords:
Status: NEW
Alias: None
Product: Security Response
Classification: Other
Component: vulnerability-draft
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On: 2553514 2553516 2553517 2553518 2553520 2553521 2553512
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-10-14 16:14 UTC by OSIDB Bzimport
Modified: 2026-10-16 04:03 UTC (History)
18 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2026-10-14 16:14:05 UTC
A vulnerability was found in SQLite's SQL parser. A VALUES clause with many rows combined with a WITH (CTE) clause forces a UNION ALL compound-SELECT fallback. The compound-SELECT depth limit is bypassed when SF_Values is set, creating an arbitrarily deep AST. When expression depth limits reject the tree, recursive cleanup could overflow the stack. The fix makes clearSelect() iterate the pPrior chain instead of recursing.

PoC: https://github.com/abraxas/sqlite-values-union

Fixed in SQLite 3.54.0 (fix in src/select.c — clearSelect() now iterative).


Note You need to log in before you can comment on or make changes to this bug.