From e14295af383009408f2e6f55a42580cbe3e49438 Mon Sep 17 00:00:00 2001 From: Daniel Handzus Date: Wed, 12 Aug 2026 15:33:45 +0200 Subject: [PATCH] Fix CVE-2026-11822 and CVE-2026-11824 Resolves: RHEL-218243 Resolves: RHEL-218251 --- ...3.26.0-CVE-2026-11822-CVE-2026-11824.patch | 71 +++++++++++++++++++ sqlite.spec | 8 ++- 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 sqlite-3.26.0-CVE-2026-11822-CVE-2026-11824.patch diff --git a/sqlite-3.26.0-CVE-2026-11822-CVE-2026-11824.patch b/sqlite-3.26.0-CVE-2026-11822-CVE-2026-11824.patch new file mode 100644 index 0000000..b80d54e --- /dev/null +++ b/sqlite-3.26.0-CVE-2026-11822-CVE-2026-11824.patch @@ -0,0 +1,71 @@ +diff -Naur sqlite-src-3260000/ext/fts5/fts5_index.c sqlite-src-3260000-patch/ext/fts5/fts5_index.c +--- sqlite-src-3260000/ext/fts5/fts5_index.c 2018-12-01 14:38:18.000000000 +0100 ++++ sqlite-src-3260000-patch/ext/fts5/fts5_index.c 2026-08-12 10:47:37.308649697 +0200 +@@ -712,7 +712,7 @@ + static Fts5Data *fts5LeafRead(Fts5Index *p, i64 iRowid){ + Fts5Data *pRet = fts5DataRead(p, iRowid); + if( pRet ){ +- if( pRet->szLeaf>pRet->nn ){ ++ if( pRet->szLeaf<4 || pRet->szLeaf>pRet->nn ){ + p->rc = FTS5_CORRUPT; + fts5DataRelease(pRet); + pRet = 0; +diff -Naur sqlite-src-3260000/ext/fts5/test/fts5corruptA.test sqlite-src-3260000-patch/ext/fts5/test/fts5corruptA.test +--- sqlite-src-3260000/ext/fts5/test/fts5corruptA.test 1970-01-01 01:00:00.000000000 +0100 ++++ sqlite-src-3260000-patch/ext/fts5/test/fts5corruptA.test 2026-08-12 15:39:06.975449775 +0200 +@@ -0,0 +1,55 @@ ++# 2026 May 11 ++# ++# The author disclaims copyright to this source code. In place of ++# a legal notice, here is a blessing: ++# ++# May you do good and not evil. ++# May you find forgiveness for yourself and forgive others. ++# May you share freely, never taking more than you give. ++# ++#*********************************************************************** ++# ++ ++source [file join [file dirname [info script]] fts5_common.tcl] ++set testprefix fts5corruptA ++ ++# If SQLITE_ENABLE_FTS5 is not defined, omit this file. ++ifcapable !fts5 { ++ finish_test ++ return ++} ++sqlite3_fts5_may_be_corrupt 1 ++ ++do_execsql_test 1.0 { ++ CREATE VIRTUAL TABLE t USING fts5(x, detail='full'); ++ INSERT INTO t(t, rank) VALUES('pgsz', 32); ++} ++ ++set big [string repeat "a " 200] ++do_execsql_test 1.1 { ++ INSERT INTO t(rowid, x) VALUES(1, $big) ++} ++ ++do_test 1.2 { ++ db eval { ++ SELECT min(rowid) AS base_rowid, count(*) AS page_count FROM t_data ++ WHERE rowid>1000 ++ } {} ++} {} ++ ++do_test 1.4 { ++ set hex [hexio_read test.db 0 [file size test.db]] ++ ++ set off [string first "023061018310" $hex] ++ set hex [string replace $hex $off [expr $off+11] 023061018370] ++ hexio_write test.db 0 $hex ++} {6144} ++ ++sqlite3 db test.db ++ ++do_catchsql_test 1.5 { ++ SELECT rowid FROM t WHERE t MATCH 'a' ++} {1 {database disk image is malformed}} ++ ++sqlite3_fts5_may_be_corrupt 0 ++finish_test diff --git a/sqlite.spec b/sqlite.spec index 0c4a79c..7fca6d3 100644 --- a/sqlite.spec +++ b/sqlite.spec @@ -10,7 +10,7 @@ Summary: Library that implements an embeddable SQL database engine Name: sqlite Version: %{rpmver} -Release: 20%{?dist} +Release: 21%{?dist} License: Public Domain Group: Applications/Databases URL: http://www.sqlite.org/ @@ -106,6 +106,8 @@ Patch37: sqlite-3.26.0-CVE-2022-35737.patch Patch38: sqlite-3.26.0-CVE-2020-24736.patch Patch39: sqlite-3.34.1-CVE-2023-7104.patch Patch40: sqlite-3.34.1-CVE-2025-6965.patch +# https://sqlite.org/src/info/4a5ad516ea93 +Patch41: sqlite-3.26.0-CVE-2026-11822-CVE-2026-11824.patch BuildRequires: ncurses-devel readline-devel glibc-devel BuildRequires: autoconf @@ -241,6 +243,7 @@ This package contains the analysis program for %{name}. %patch -P 38 -p1 %patch -P 39 -p1 %patch -P 40 -p1 +%patch -P 41 -p1 # Remove backup-file @@ -342,6 +345,9 @@ make test %endif %changelog +* Wed Aug 12 2026 Daniel Handzus - 3.26.0-21 +- Fixes CVE-2026-11822 and CVE-2026-11824 + * Thu Jul 17 2025 Ales Nezbeda - 3.26.0-20 - Fixes CVE-2025-6965