Bug 1791313 (CVE-2019-20218) - CVE-2019-20218 sqlite: selectExpander in select.c proceeds with WITH stack unwinding even after a parsing error
Summary: CVE-2019-20218 sqlite: selectExpander in select.c proceeds with WITH stack un...
Keywords:
Status: NEW
Alias: CVE-2019-20218
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1791316 1791592 1791315 1791317 1791591
Blocks: 1791314
TreeView+ depends on / blocked
 
Reported: 2020-01-15 14:04 UTC by Guilherme de Almeida Suckevicz
Modified: 2020-01-16 09:20 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

Description Guilherme de Almeida Suckevicz 2020-01-15 14:04:29 UTC
selectExpander in select.c in SQLite 3.30.1 proceeds with WITH stack unwinding even after a parsing error.

Reference and upstream commit:
https://github.com/sqlite/sqlite/commit/a6c1a71cde082e09750465d5675699062922e387

Comment 1 Guilherme de Almeida Suckevicz 2020-01-15 14:06:36 UTC
Created mingw-sqlite tracking bugs for this issue:

Affects: epel-7 [bug 1791315]
Affects: fedora-all [bug 1791316]


Created sqlite tracking bugs for this issue:

Affects: fedora-all [bug 1791317]

Comment 2 Huzaifa S. Sidhpurwala 2020-01-16 08:29:08 UTC
There seems to be a reproducer in the upstream commit:

[huzaifas@babylon ~]$ cat a.sql 
CREATE TABLE v0 (a);
CREATE VIEW v2 (v3) AS WITH x1 AS (SELECT * FROM v2) SELECT v3 AS x, v3 AS y FROM v2; 
SELECT * FROM v2;
[huzaifas@babylon ~]$ sqlite3 < a.sql 
Segmentation fault (core dumped)
[huzaifas@babylon ~]$ 


Valgrind suggests that the problem is conditional jump based on uninitialized value and corresponding OOB read.


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