diff --git a/sqlite-3.34.1-CVE-2023-7104.patch b/sqlite-3.34.1-CVE-2023-7104.patch new file mode 100644 index 0000000000000000000000000000000000000000..6b9c1b7768937db32a526e5e258715e5265724fa --- /dev/null +++ b/sqlite-3.34.1-CVE-2023-7104.patch @@ -0,0 +1,42 @@ +From 09f1652f36c5c4e8a6a640ce887f9ea0f48a7958 Mon Sep 17 00:00:00 2001 +From: dan +Date: Thu, 7 Sep 2023 13:53:09 +0000 +Subject: [PATCH] Fix a buffer overread in the sessions extension that could + occur when processing a corrupt changeset. + +FossilOrigin-Name: 0e4e7a05c4204b47a324d67e18e76d2a98e26b2723d19d5c655ec9fd2e41f4b7 + +diff --git a/ext/session/sqlite3session.c b/ext/session/sqlite3session.c +index 9f862f2465..0491549231 100644 +--- a/ext/session/sqlite3session.c ++++ b/ext/session/sqlite3session.c +@@ -2811,15 +2811,19 @@ static int sessionReadRecord( + } + } + if( eType==SQLITE_INTEGER || eType==SQLITE_FLOAT ){ +- sqlite3_int64 v = sessionGetI64(aVal); +- if( eType==SQLITE_INTEGER ){ +- sqlite3VdbeMemSetInt64(apOut[i], v); ++ if( (pIn->nData-pIn->iNext)<8 ){ ++ rc = SQLITE_CORRUPT_BKPT; + }else{ +- double d; +- memcpy(&d, &v, 8); +- sqlite3VdbeMemSetDouble(apOut[i], d); ++ sqlite3_int64 v = sessionGetI64(aVal); ++ if( eType==SQLITE_INTEGER ){ ++ sqlite3VdbeMemSetInt64(apOut[i], v); ++ }else{ ++ double d; ++ memcpy(&d, &v, 8); ++ sqlite3VdbeMemSetDouble(apOut[i], d); ++ } ++ pIn->iNext += 8; + } +- pIn->iNext += 8; + } + } + } +-- +2.43.0 + diff --git a/sqlite.spec b/sqlite.spec index fad90c40ed36ed6073c93b0a6c6c88b7d61d264e..52bab888594e80bb9036d696ffb48f712ced6c06 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: 18%{?dist} +Release: 19%{?dist} License: Public Domain Group: Applications/Databases URL: http://www.sqlite.org/ @@ -101,6 +101,8 @@ Patch36: sqlite-3.26.0-CVE-2020-35525.patch # Fix for CVE-2022-35737 # https://www.sqlite.org/src/info/26db4fc22fe66658 Patch37: sqlite-3.26.0-CVE-2022-35737.patch +# https://sqlite.org/src/info/0e4e7a05c4204b47 +Patch38: sqlite-3.34.1-CVE-2023-7104.patch Patch1000: 1000-Crash-due-to-misuse-of-window-functions.patch @@ -235,6 +237,7 @@ This package contains the analysis program for %{name}. %patch35 -p1 %patch36 -p1 %patch37 -p1 +%patch38 -p1 %patch1000 -p1 @@ -338,6 +341,9 @@ make test %endif %changelog +* Wed Jan 24 2024 Bo Liu - 3.26.0-19 +- Fixed CVE-2023-7104 + * Thu Jun 29 2023 Liwei Ge - 3.26.0-18 - Fixed CVE-2020-24736