Bug 1851957 (CVE-2020-15358)

Summary: CVE-2020-15358 sqlite: heap-based buffer overflow in multiSelectOrderBy due to mishandling of query-flattener optimization in select.c
Product: [Other] Security Response Reporter: Guilherme de Almeida Suckevicz <gsuckevi>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: alex, databases-maint, drizt72, erik-fedora, fedora, itamar, mschorm, odubaj, pkubat, praiskup, rh-spice-bugs, rjones, spotrh, wilmer5
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sqlite 3.32.3 Doc Type: If docs needed, set a value
Doc Text:
A heap buffer overflow was found in SQLite in the query flattening optimization technique. This flaw allows an attacker to execute SQL statements to crash the application, resulting in a denial of service.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 14:34:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1851962, 1851963, 1855208    
Bug Blocks: 1851961    

Description Guilherme de Almeida Suckevicz 2020-06-29 14:17:06 UTC
In SQLite before 3.32.3, select.c mishandles query-flattener optimization, leading to a multiSelectOrderBy heap overflow because of misuse of transitive properties for constant propagation.

Reference:
https://www.sqlite.org/src/tktview?name=8f157e8010

Upstream commit:
https://www.sqlite.org/src/info/10fa79d00f8091e5

Comment 1 Guilherme de Almeida Suckevicz 2020-06-29 14:21:51 UTC
Created mingw-sqlite tracking bugs for this issue:

Affects: fedora-all [bug 1851962]


Created sqlite tracking bugs for this issue:

Affects: fedora-all [bug 1851963]

Comment 2 Mauro Matteo Cascella 2020-07-09 08:49:19 UTC
As noted here: https://www.sqlite.org/src/tktview?name=8f157e8010
this bug was apparently introduced in upstream version 3.25.0 with the new use of transitive properties for constant propagation.

Comment 4 Mauro Matteo Cascella 2020-07-09 08:58:57 UTC
Statement:

This flaw did not affect the versions of SQLite as shipped with Red Hat Enterprise Linux 7 as they did not include support for the WHERE-clause constant propagation optimization. This optimization was introduced in a later version of the package (3.25.0).

Comment 6 errata-xmlrpc 2021-05-18 13:21:47 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2021:1581 https://access.redhat.com/errata/RHSA-2021:1581

Comment 7 errata-xmlrpc 2021-05-18 13:27:52 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2021:1581 https://access.redhat.com/errata/RHSA-2021:1581

Comment 8 Product Security DevOps Team 2021-05-18 14:34:38 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2020-15358