sqlite3: Fix CVE-2026-119377
PATCH 1/10 sqlite3: Fix CVE-2026-119377
This patch applies the upstream fix series [1], [3], [5], and [7] for the authorizer bypass. Commits [1] and [3] are dependent commits. Commit
[5] adds authorizer checks for RIGHT JOIN USING terms, and commit [7] corrects the loop so every term is checked. The GitHub mirror commits correspond to the SQLite Fossil check-ins shown in [2], [4], [6], and [8], respectively.
[1] https://github.com/sqlite/sqlite/commit/c70fbd39f9c130bbe1cc45269c3b490dfdf7f259
[2] https://sqlite.org/src/info/625f78a630bb
[3] https://github.com/sqlite/sqlite/commit/ddea119f825bf07f145c55f623022286bc644664
[4] https://sqlite.org/src/info/4ef88a36f9d9
[5] https://github.com/sqlite/sqlite/commit/7ff247c5b9ead3ad8a69c26d3fd264878e127237
[6] https://sqlite.org/src/info/bbd69ce27462
[7] https://github.com/sqlite/sqlite/commit/5694c3bb2a6a40770ecd2f65910eea756734dfd8
[8] https://sqlite.org/src/info/2cb228776836
Reference:
https://nvd.nist.gov/vuln/detail/CVE-2026-119377
--- .../CVE-2026-119377-dependent_p1.patch | 86 +++++++++++++++++++ .../CVE-2026-119377-dependent_p2.patch | 59 +++++++++++++ .../sqlite/sqlite3/CVE-2026-119377_p1.patch | 52 +++++++++++ .../sqlite/sqlite3/CVE-2026-119377_p2.patch | 51 +++++++++++ meta/recipes-support/sqlite/sqlite3_3.45.3.bb | 4 + 5 files changed, 252 insertions(+) create mode 100644 meta/recipes-support/sqlite/sqlite3/CVE-2026-119377-dependent_p1.patch create mode 100644 meta/recipes-support/sqlite/sqlite3/CVE-2026-119377-dependent_p2.patch create mode 100644 meta/recipes-support/sqlite/sqlite3/CVE-2026-119377_p1.patch create mode 100644 meta/recipes-support/sqlite/sqlite3/CVE-2026-119377_p2.patch
meta/recipes-support/sqlite/sqlite3/CVE-2026-119377-dependent_p1.patch new file +86 -0
@@ -0,0 +1,86 @@ +From c3cab0322ae36fe6ca21df300c670af379c0a423 Mon Sep 17 00:00:00 2001 +From: drh <> +Date: Sat, 2 May 2026 17:30:33 +0000 +Subject: [PATCH] Minor optimization to the authorizer. + +FossilOrigin-Name: 625f78a630bbf897f945065f1b85a92fe26e426302c8f6edc4d26a817ff62358 + +CVE: CVE-2026-119377 +Upstream-Status: Backport [https://github.com/sqlite/sqlite/commit/c70fbd39f9c130bbe1cc45269c3b490dfdf7f259] + +Backport Changes: +- Applied the src/auth.c and src/resolve.c changes to sqlite3.c because + the Yocto sqlite-autoconf source uses the amalgamated SQLite layout. +- Kept SQLITE_PRIVATE on sqlite3AuthCheck() to match the amalgamated + source. +- Omitted manifest and manifest.uuid because they are repository + metadata and are not needed for this sqlite3.c backport. + +Signed-off-by: Arpit Patel <[email protected]> +--- + sqlite3.c | 27 ++++++++++++++++++++++----- + 1 file changed, 22 insertions(+), 5 deletions(-) + +diff --git a/sqlite3.c b/sqlite3.c +index 6acf46a5b5..3bab6d7638 100644 +--- a/sqlite3.c ++++ b/sqlite3.c +@@ -107075,9 +107075,7 @@ lookupname_end: + if( cnt==1 ){ + assert( pNC!=0 ); + #ifndef SQLITE_OMIT_AUTHORIZATION +- if( pParse->db->xAuth +- && (pExpr->op==TK_COLUMN || pExpr->op==TK_TRIGGER) +- ){ ++ if( db->xAuth && (pExpr->op==TK_COLUMN || pExpr->op==TK_TRIGGER) ){ + sqlite3AuthRead(pParse, pExpr, pSchema, pNC->pSrcList); + } + #endif +@@ -120685,8 +120683,14 @@ SQLITE_PRIVATE void sqlite3AuthRead( + ** either SQLITE_OK (zero) or SQLITE_IGNORE or SQLITE_DENY. If SQLITE_DENY + ** is returned, then the error count and error message in pParse are + ** modified appropriately. ++** ++** Divided into two routines. realAuthCheck() does the work. The ++** sqlite3AuthCheck() routine is usually a fast no-op but invokes ++** realAuthCheck() (and spends time doing some stack pushes and pops ++** as a result) in the uncommon case where an authorization check is ++** actually needed. + */ +-SQLITE_PRIVATE int sqlite3AuthCheck( ++static int SQLITE_NOINLINE realAuthCheck( + Parse *pParse, + int code, + const char *zArg1, +@@ -120700,7 +120704,7 @@ SQLITE_PRIVATE int sqlite3AuthCheck( + ** or if the parser is being invoked from within sqlite3_declare_vtab. + */ + assert( !IN_RENAME_OBJECT || db->xAuth==0 ); +- if( db->xAuth==0 || db->init.busy || IN_SPECIAL_PARSE ){ ++ if( IN_SPECIAL_PARSE ){ + return SQLITE_OK; + } + +@@ -120729,6 +120733,19 @@ SQLITE_PRIVATE int sqlite3AuthCheck( + } + return rc; + } ++SQLITE_PRIVATE int sqlite3AuthCheck( ++ Parse *pParse, ++ int code, ++ const char *zArg1, ++ const char *zArg2, ++ const char *zArg3 ++){ ++ if( pParse->db->xAuth!=0 && pParse->db->init.busy==0 ){ ++ return realAuthCheck(pParse,code,zArg1,zArg2,zArg3); ++ }else{ ++ return SQLITE_OK; ++ } ++} + + /* + ** Push an authorization context. After this routine is called, the +-- +2.35.6 +
meta/recipes-support/sqlite/sqlite3/CVE-2026-119377-dependent_p2.patch new file +59 -0
59 lines not on this page · raw message
meta/recipes-support/sqlite/sqlite3/CVE-2026-119377_p1.patch new file +52 -0
52 lines not on this page · raw message
meta/recipes-support/sqlite/sqlite3/CVE-2026-119377_p2.patch new file +51 -0
51 lines not on this page · raw message
meta/recipes-support/sqlite/sqlite3_3.45.3.bb +4 -0
@@ -10,6 +10,10 @@ SRC_URI = "http://www.sqlite.org/2024/sqlite-autoconf-${SQLITE_PV}.tar.gz \ file://CVE-2025-7709.patch \ file://CVE-2025-70873.patch \ file://CVE-2026-11822_CVE-2026-11824.patch \ + file://CVE-2026-119377-dependent_p1.patch \ + file://CVE-2026-119377-dependent_p2.patch \ + file://CVE-2026-119377_p1.patch \ + file://CVE-2026-119377_p2.patch \ " SRC_URI[sha256sum] = "b2809ca53124c19c60f42bf627736eae011afdcc205bb48270a5ee9a38191531"
Signature · 1 line
2.35.6
PATCH 2/10 sqlite3: fix CVE-2026-119373
This patch applies the upstream fix [1], which prevents a buffer overflow when merging FTS5 detail=none prefix lists with negative docids. The GitHub mirror commit [1] corresponds to the SQLite Fossil check-in shown in [2].
[1] https://github.com/sqlite/sqlite/commit/e1c9934f9f11a499029abb020ea715a08970da80
[2] https://sqlite.org/src/info/a7f8c92f62
Reference:
https://nvd.nist.gov/vuln/detail/CVE-2026-119373
--- .../sqlite/sqlite3/CVE-2026-119373.patch | 56 +++++++++++++++++++ meta/recipes-support/sqlite/sqlite3_3.45.3.bb | 1 + 2 files changed, 57 insertions(+) create mode 100644 meta/recipes-support/sqlite/sqlite3/CVE-2026-119373.patch
meta/recipes-support/sqlite/sqlite3/CVE-2026-119373.patch new file +56 -0
@@ -0,0 +1,56 @@ +From 2ea652e191b5fd3e2ff13eadd907519b74e3db94 Mon Sep 17 00:00:00 2001 +From: dan <Dan Kennedy> +Date: Tue, 4 Aug 2026 11:04:17 +0000 +Subject: [PATCH] In fts5, account for the possibility of negative docids when + allocating a buffer to store the results of merging detail=none prefix lists. + Fix for report [bugs:/info/2026-08-04T08:49:27Z | 2026-08-04T08:49:27Z]. + +FossilOrigin-Name: a7f8c92f623e9cbe8a61266d949916acc9e5110c94dff4aa6fd1ad2ea8a60d4e + +CVE: CVE-2026-119373 +Upstream-Status: Backport [https://github.com/sqlite/sqlite/commit/e1c9934f9f11a499029abb020ea715a08970da80] + +Backport Changes: +- Applied the FTS5 fix from ext/fts5/fts5_index.c to sqlite3.c because + the recipe source uses the amalgamated SQLite layout. +- Omitted ext/fts5/test/fts5prefix2.test because the extracted source + does not include SQLite's Tcl test tree. +- Omitted manifest and manifest.uuid because they are Fossil + repository metadata and are not needed for this source patch. + +Signed-off-by: Arpit Patel <[email protected]> +--- + sqlite3.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/sqlite3.c b/sqlite3.c +index 7761d83d08..9d5790a0d9 100644 +--- a/sqlite3.c ++++ b/sqlite3.c +@@ -244833,7 +244833,7 @@ static void fts5MergeRowidLists( + (void)nBuf; + memset(&out, 0, sizeof(out)); + assert( nBuf==1 ); +- sqlite3Fts5BufferSize(&p->rc, &out, p1->n + p2->n); ++ sqlite3Fts5BufferSize(&p->rc, &out, p1->n + p2->n + 9); + if( p->rc ) return; + + fts5NextRowid(p1, &i1, &iRowid1); +@@ -244841,12 +244841,12 @@ static void fts5MergeRowidLists( + while( i1>=0 || i2>=0 ){ + if( i1>=0 && (i2<0 || iRowid1<iRowid2) ){ + assert( iOut==0 || iRowid1>iOut ); +- fts5BufferSafeAppendVarint(&out, iRowid1 - iOut); ++ fts5BufferSafeAppendVarint(&out, (u64)iRowid1 - (u64)iOut); + iOut = iRowid1; + fts5NextRowid(p1, &i1, &iRowid1); + }else{ + assert( iOut==0 || iRowid2>iOut ); +- fts5BufferSafeAppendVarint(&out, iRowid2 - iOut); ++ fts5BufferSafeAppendVarint(&out, (u64)iRowid2 - (u64)iOut); + iOut = iRowid2; + if( i1>=0 && iRowid1==iRowid2 ){ + fts5NextRowid(p1, &i1, &iRowid1); +-- +2.35.6 +
meta/recipes-support/sqlite/sqlite3_3.45.3.bb +1 -0
@@ -14,6 +14,7 @@ SRC_URI = "http://www.sqlite.org/2024/sqlite-autoconf-${SQLITE_PV}.tar.gz \ file://CVE-2026-119377-dependent_p2.patch \ file://CVE-2026-119377_p1.patch \ file://CVE-2026-119377_p2.patch \ + file://CVE-2026-119373.patch \ " SRC_URI[sha256sum] = "b2809ca53124c19c60f42bf627736eae011afdcc205bb48270a5ee9a38191531"
Signature · 1 line
2.35.6
Re: [OE-core][scarthgap][PATCH 02/10] sqlite3: fix CVE-2026-119373
Quoted 11 lines · Arpit Patel via openembedded-core
This patch applies the upstream fix [1], which prevents a buffer overflow when merging FTS5 detail=none prefix lists with negative docids. The GitHub mirror commit [1] corresponds to the SQLite Fossil check-in shown in [2].
[1] https://github.com/sqlite/sqlite/commit/e1c9934f9f11a499029abb020ea715a08970da80
[2] https://sqlite.org/src/info/a7f8c92f62
Quoted 6 lines
Signed-off-by Arpit Patel <[email protected]>--- .../sqlite/sqlite3/CVE-2026-119373.patch | 56 +++++++++++++++++++ meta/recipes-support/sqlite/sqlite3_3.45.3.bb | 1 + 2 files changed, 57 insertions(+) create mode 100644 meta/recipes-support/sqlite/sqlite3/CVE-2026-119373.patch
Hello,
FYI, from this series I removed 2,3,5/10: those CVE fixes were sent a day earlier by João:
https://lore.kernel.org/all/[email protected]/
Please help review them, during the review cycle.
Regards,
Signature · 2 lines
Yoann Congal Smile ECS
PATCH 3/10 sqlite3: fix CVE-2026-119374
In reply to Arpit PatelThis patch applies the upstream fix [1], which addresses an FTS5 secure-delete buffer overrun when handling a corrupted database. The GitHub mirror commit [1] corresponds to the SQLite Fossil check-in shown in [2].
[1] https://github.com/sqlite/sqlite/commit/d9de6eedbe918c074c7556400fa21df5960704d9
[2] https://sqlite.org/src/info/9cd4f9e920
Reference:
https://nvd.nist.gov/vuln/detail/CVE-2026-119374
--- .../sqlite/sqlite3/CVE-2026-119374.patch | 78 +++++++++++++++++++ meta/recipes-support/sqlite/sqlite3_3.45.3.bb | 1 + 2 files changed, 79 insertions(+) create mode 100644 meta/recipes-support/sqlite/sqlite3/CVE-2026-119374.patch
meta/recipes-support/sqlite/sqlite3/CVE-2026-119374.patch new file +78 -0
@@ -0,0 +1,78 @@ +From 6875e24f0c0612feccb97ab4c3f92c8444833373 Mon Sep 17 00:00:00 2001 +From: dan <Dan Kennedy> +Date: Tue, 11 Aug 2026 14:16:12 +0000 +Subject: [PATCH] Fix a problem in fts5 secure-delete code that could lead to a + buffer overrun when dealing with a strategically corrupted database. Problem + reported by YEONBA. + +FossilOrigin-Name: 9cd4f9e9205c5a5096388397a39349db9ff5377d19095c6b20388ff799969c31 + +CVE: CVE-2026-119374 +Upstream-Status: Backport [https://github.com/sqlite/sqlite/commit/d9de6eedbe918c074c7556400fa21df5960704d9] + +Backport Changes: +- Applied the fix from ext/fts5/fts5_index.c to sqlite3.c because the + recipe uses SQLite's amalgamated source. +- Used p->rc = FTS5_CORRUPT; because current version of SQLite does + not define the newer FTS5_CORRUPT_IDX(p) helper. +- Omitted ext/fts5/test/fts5corruptB.test because the extracted source + does not include the upstream Tcl test tree. +- Omitted manifest and manifest.uuid because they are Fossil metadata + and are not needed for this source patch. + +Signed-off-by: Arpit Patel <[email protected]> +--- + sqlite3.c | 18 +++++++++++------- + 1 file changed, 11 insertions(+), 7 deletions(-) + +diff --git a/sqlite3.c b/sqlite3.c +index 9d5790a0d9..a397e4d36b 100644 +--- a/sqlite3.c ++++ b/sqlite3.c +@@ -244270,32 +244270,36 @@ static void fts5DoSecureDelete( + if( p->rc==SQLITE_OK ){ + const int nMove = nPg - iNextOff; /* Number of bytes to move */ + int nShift = iNextOff - iOff; /* Distance to move them */ +- ++ int nNewPg = 0; + int iPrevKeyOut = 0; +- int iKeyIn = 0; ++ i64 iKeyIn = 0; + + memmove(&aPg[iOff], &aPg[iNextOff], nMove); + iPgIdx -= nShift; +- nPg = iPgIdx; ++ nNewPg = iPgIdx; + fts5PutU16(&aPg[2], iPgIdx); + + for(iIdx=0; iIdx<nIdx; /* no-op */){ + u32 iVal = 0; + iIdx += fts5GetVarint32(&aIdx[iIdx], iVal); + iKeyIn += iVal; ++ if( iKeyIn>nPg ){ ++ p->rc = FTS5_CORRUPT; ++ break; ++ } + if( iKeyIn!=iDelKeyOff ){ + int iKeyOut = (iKeyIn - (iKeyIn>iOff ? nShift : 0)); +- nPg += sqlite3Fts5PutVarint(&aPg[nPg], iKeyOut - iPrevKeyOut); ++ nNewPg += sqlite3Fts5PutVarint(&aPg[nNewPg], iKeyOut - iPrevKeyOut); + iPrevKeyOut = iKeyOut; + } + } + +- if( iPgIdx==nPg && nIdx>0 && pSeg->iLeafPgno!=1 ){ ++ if( p->rc==SQLITE_OK && iPgIdx==nNewPg && nIdx>0 && pSeg->iLeafPgno!=1 ){ + fts5SecureDeleteIdxEntry(p, iSegid, pSeg->iLeafPgno); + } + +- assert_nc( nPg>4 || fts5GetU16(aPg)==0 ); +- fts5DataWrite(p, FTS5_SEGMENT_ROWID(iSegid,pSeg->iLeafPgno), aPg, nPg); ++ assert_nc( nNewPg>4 || fts5GetU16(aPg)==0 ); ++ fts5DataWrite(p, FTS5_SEGMENT_ROWID(iSegid,pSeg->iLeafPgno), aPg, nNewPg); + } + sqlite3_free(aIdx); + } +-- +2.35.6 +
meta/recipes-support/sqlite/sqlite3_3.45.3.bb +1 -0
@@ -15,6 +15,7 @@ SRC_URI = "http://www.sqlite.org/2024/sqlite-autoconf-${SQLITE_PV}.tar.gz \ file://CVE-2026-119377_p1.patch \ file://CVE-2026-119377_p2.patch \ file://CVE-2026-119373.patch \ + file://CVE-2026-119374.patch \ " SRC_URI[sha256sum] = "b2809ca53124c19c60f42bf627736eae011afdcc205bb48270a5ee9a38191531"
Signature · 1 line
2.35.6
PATCH 4/10 sqlite3: fix CVE-2026-119375
In reply to Arpit PatelThis patch applies the upstream fix [1], which fully initializes the page read when the WAL and database page sizes differ, preventing disclosure of uninitialized page data. The GitHub mirror commit [1] corresponds to the SQLite Fossil check-in shown in [2].
[1] https://github.com/sqlite/sqlite/commit/e5bf119821f25be1d7f10ef0a2edbe175289166e
[2] https://sqlite.org/src/info/f9b4ee369557c36c
Reference:
https://nvd.nist.gov/vuln/detail/CVE-2026-119375
--- .../sqlite/sqlite3/CVE-2026-119375.patch | 47 +++++++++++++++++++ meta/recipes-support/sqlite/sqlite3_3.45.3.bb | 1 + 2 files changed, 48 insertions(+) create mode 100644 meta/recipes-support/sqlite/sqlite3/CVE-2026-119375.patch
meta/recipes-support/sqlite/sqlite3/CVE-2026-119375.patch new file +47 -0
@@ -0,0 +1,47 @@ +From c9e05db641c387aad309081b35afa3e703aa075d Mon Sep 17 00:00:00 2001 +From: drh <> +Date: Sun, 16 Aug 2026 10:49:39 +0000 +Subject: [PATCH] When reading a frame from a WAL file where the WAL pagesize + and the database pagesize disagree, be sure to fully initialize the page that + is read. + +FossilOrigin-Name: f9b4ee369557c36c606666bd7e6d8dc4685d87531993d3ce4e7a718aa814a5ac + +CVE: CVE-2026-119375 +Upstream-Status: Backport [https://github.com/sqlite/sqlite/commit/e5bf119821f25be1d7f10ef0a2edbe175289166e] + +Backport Changes: +- Applied the src/wal.c change to sqlite3.c because the recipe source + uses the amalgamated SQLite layout. +- Omitted manifest and manifest.uuid because they are Fossil + repository metadata and are not needed in this source patch. + +Signed-off-by: Arpit Patel <[email protected]> +--- + sqlite3.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/sqlite3.c b/sqlite3.c +index a397e4d36b..afcf2b1969 100644 +--- a/sqlite3.c ++++ b/sqlite3.c +@@ -68201,11 +68201,15 @@ SQLITE_PRIVATE int sqlite3WalReadFrame( + i64 iOffset; + sz = pWal->hdr.szPage; + sz = (sz&0xfe00) + ((sz&0x0001)<<16); ++ if( nOut>sz ){ ++ memset(pOut+sz, 0, nOut-sz); ++ nOut = sz; ++ } + testcase( sz<=32768 ); + testcase( sz>=65536 ); + iOffset = walFrameOffset(iRead, sz) + WAL_FRAME_HDRSIZE; + /* testcase( IS_BIG_INT(iOffset) ); // requires a 4GiB WAL */ +- return sqlite3OsRead(pWal->pWalFd, pOut, (nOut>sz ? sz : nOut), iOffset); ++ return sqlite3OsRead(pWal->pWalFd, pOut, nOut, iOffset); + } + + /* +-- +2.35.6 +
meta/recipes-support/sqlite/sqlite3_3.45.3.bb +1 -0
@@ -16,6 +16,7 @@ SRC_URI = "http://www.sqlite.org/2024/sqlite-autoconf-${SQLITE_PV}.tar.gz \ file://CVE-2026-119377_p2.patch \ file://CVE-2026-119373.patch \ file://CVE-2026-119374.patch \ + file://CVE-2026-119375.patch \ " SRC_URI[sha256sum] = "b2809ca53124c19c60f42bf627736eae011afdcc205bb48270a5ee9a38191531"
Signature · 1 line
2.35.6
PATCH 5/10 sqlite3: fix CVE-2026-119379
In reply to Arpit PatelThis patch applies the upstream fix [1], which prevents a buffer overrun when applying a strategically corrupted changeset through SQLite's session extension. The GitHub mirror commit [1] corresponds to the SQLite Fossil check-in shown in [2].
[1] https://github.com/sqlite/sqlite/commit/64459c87cc702d600704fb77ee40ca1782398a52
[2] https://sqlite.org/src/info/3f57024aecea0f3b
Reference:
https://nvd.nist.gov/vuln/detail/CVE-2026-119379
--- .../sqlite/sqlite3/CVE-2026-119379.patch | 78 +++++++++++++++++++ meta/recipes-support/sqlite/sqlite3_3.45.3.bb | 1 + 2 files changed, 79 insertions(+) create mode 100644 meta/recipes-support/sqlite/sqlite3/CVE-2026-119379.patch
meta/recipes-support/sqlite/sqlite3/CVE-2026-119379.patch new file +78 -0
@@ -0,0 +1,78 @@ +From 17e3b5a6f6c3a5e852a86597ad68f259d802296a Mon Sep 17 00:00:00 2001 +From: dan <Dan Kennedy> +Date: Mon, 17 Aug 2026 11:31:59 +0000 +Subject: [PATCH] Avoid a buffer overrun when processing a strategically + corrupted changeset. Report [bugs:/info/2026-08-16T10:15:25Z | + 2026-08-16T10:15:25Z]. + +FossilOrigin-Name: 3f57024aecea0f3b565ed823cf94b085031c481fd6323c1f2e4319a53500864f + +CVE: CVE-2026-119379 +Upstream-Status: Backport [https://github.com/sqlite/sqlite/commit/64459c87cc702d600704fb77ee40ca1782398a52] + +Backport Changes: +- Applied the ext/session/sqlite3session.c fix to sqlite3.c because + the recipe source uses the amalgamated SQLite layout. +- Omitted ext/session/sessioncorrupt.test because the extracted source + does not include the upstream test tree. +- Omitted manifest and manifest.uuid because they are Fossil + metadata and are not required for this backport. + +Signed-off-by: Arpit Patel <[email protected]> +--- + sqlite3.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +diff --git a/sqlite3.c b/sqlite3.c +index 52bd4aa19c..8cbe1d3ec7 100644 +--- a/sqlite3.c ++++ b/sqlite3.c +@@ -228425,9 +228425,9 @@ static int sessionChangesetApply( + int schemaMismatch = 0; + int rc = SQLITE_OK; /* Return code */ + const char *zTab = 0; /* Name of current table */ +- int nTab = 0; /* Result of sqlite3Strlen30(zTab) */ + SessionApplyCtx sApply; /* changeset_apply() context object */ + int bPatchset; ++ int bNew = 0; /* True for first entry of new table */ + + assert( xConflict!=0 ); + +@@ -228443,15 +228443,16 @@ static int sessionChangesetApply( + if( rc==SQLITE_OK ){ + rc = sqlite3_exec(db, "PRAGMA defer_foreign_keys = 1", 0, 0, 0); + } +- while( rc==SQLITE_OK && SQLITE_ROW==sqlite3changeset_next(pIter) ){ ++ while( rc==SQLITE_OK && SQLITE_ROW==sessionChangesetNext(pIter, 0, 0,&bNew) ){ + int nCol; + int op; + const char *zNew; + + sqlite3changeset_op(pIter, &zNew, &nCol, &op, 0); + +- if( zTab==0 || sqlite3_strnicmp(zNew, zTab, nTab+1) ){ ++ if( bNew ){ + u8 *abPK; ++ bNew = 0; + + rc = sessionRetryConstraints( + db, pIter->bPatchset, zTab, &sApply, xConflict, pCtx +@@ -228486,7 +228487,6 @@ static int sessionChangesetApply( + rc = SQLITE_NOMEM; + break; + } +- nTab = (int)strlen(zTab); + sApply.azCol = (const char **)zTab; + }else{ + int nMinCol = 0; +@@ -228538,7 +228538,6 @@ static int sessionChangesetApply( + sApply.bStat1 = 0; + } + } +- nTab = sqlite3Strlen30(zTab); + } + } + +-- +2.35.6 +
meta/recipes-support/sqlite/sqlite3_3.45.3.bb +1 -0
@@ -17,6 +17,7 @@ SRC_URI = "http://www.sqlite.org/2024/sqlite-autoconf-${SQLITE_PV}.tar.gz \ file://CVE-2026-119373.patch \ file://CVE-2026-119374.patch \ file://CVE-2026-119375.patch \ + file://CVE-2026-119379.patch \ " SRC_URI[sha256sum] = "b2809ca53124c19c60f42bf627736eae011afdcc205bb48270a5ee9a38191531"
Signature · 1 line
2.35.6
PATCH 6/10 sqlite3: fix CVE-2026-119372
In reply to Arpit PatelThis patch applies the upstream fix [1], which prevents a use-after-free in FTS3 snippet() processing. The GitHub mirror commit [1] corresponds to the SQLite Fossil check-in shown in [2].
[1] https://github.com/sqlite/sqlite/commit/a87bd2471a9c0606e78d3c3678bcd9cecaa0e731
[2] https://sqlite.org/src/info/e4635c41536a
Reference:
https://nvd.nist.gov/vuln/detail/CVE-2026-119372
--- .../sqlite/sqlite3/CVE-2026-119372.patch | 56 +++++++++++++++++++ meta/recipes-support/sqlite/sqlite3_3.45.3.bb | 1 + 2 files changed, 57 insertions(+) create mode 100644 meta/recipes-support/sqlite/sqlite3/CVE-2026-119372.patch
meta/recipes-support/sqlite/sqlite3/CVE-2026-119372.patch new file +56 -0
@@ -0,0 +1,56 @@ +From a5fe767d0ba12d3082bd22b3c5341fdb6cc6ef95 Mon Sep 17 00:00:00 2001 +From: dan <Dan Kennedy> +Date: Mon, 17 Aug 2026 13:55:38 +0000 +Subject: [PATCH] Avoid a problem causing a use-after-free in the fts3 + snippet() function. Report [bugs:/info/2026-08-17T09:18:24Z | + 2026-08-17T09:18:24Z]. + +FossilOrigin-Name: e4635c41536a0b3620780c3f1c872de33121370bafb608fce9fe7e3113e2ae01 + +CVE: CVE-2026-119372 +Upstream-Status: Backport [https://github.com/sqlite/sqlite/commit/a87bd2471a9c0606e78d3c3678bcd9cecaa0e731] + +Backport Changes: +- Applied the ext/fts3/fts3_snippet.c fix to sqlite3.c because the + recipe source uses the amalgamated SQLite layout. +- Omitted test/fts3snippet2.test because the extracted source does not + include the upstream Tcl test tree. +- Omitted manifest and manifest.uuid because they are Fossil + repository metadata and are not needed for this source patch. + +Signed-off-by: Arpit Patel <[email protected]> +--- + sqlite3.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/sqlite3.c b/sqlite3.c +index 8cbe1d3ec7..62a8d5128b 100644 +--- a/sqlite3.c ++++ b/sqlite3.c +@@ -201458,6 +201458,7 @@ static int fts3BestSnippet( + sqlite3_int64 nByte; /* Number of bytes of space to allocate */ + int iBestScore = -1; /* Best snippet score found so far */ + int i; /* Loop counter */ ++ Fts3Expr *pExpr = pCsr->pExpr; + + memset(&sIter, 0, sizeof(sIter)); + +@@ -201486,9 +201487,12 @@ static int fts3BestSnippet( + sIter.nSnippet = nSnippet; + sIter.nPhrase = nList; + sIter.iCurrent = -1; +- rc = sqlite3Fts3ExprIterate( +- pCsr->pExpr, fts3SnippetFindPositions, (void*)&sIter +- ); ++ rc = sqlite3Fts3ExprIterate(pExpr, fts3SnippetFindPositions, (void*)&sIter); ++ if( rc==SQLITE_OK ){ ++ /* Iterate through the expression twice, in case pointers garnered during ++ ** the first iteration are invalidated by a call to fts5EvalRestart(). */ ++ rc = sqlite3Fts3ExprIterate(pExpr, fts3SnippetFindPositions, (void*)&sIter); ++ } + if( rc==SQLITE_OK ){ + + /* Set the *pmSeen output variable. */ +-- +2.35.6 +
meta/recipes-support/sqlite/sqlite3_3.45.3.bb +1 -0
@@ -18,6 +18,7 @@ SRC_URI = "http://www.sqlite.org/2024/sqlite-autoconf-${SQLITE_PV}.tar.gz \ file://CVE-2026-119374.patch \ file://CVE-2026-119375.patch \ file://CVE-2026-119379.patch \ + file://CVE-2026-119372.patch \ " SRC_URI[sha256sum] = "b2809ca53124c19c60f42bf627736eae011afdcc205bb48270a5ee9a38191531"
Signature · 1 line
2.35.6
PATCH 7/10 sqlite3: fix CVE-2026-119378
In reply to Arpit PatelThis patch applies the upstream fix [1], which prevents a use-after-free in R-Tree when a manipulated shadow-table schema causes sqlite3_last_insert_rowid() to return 0. The GitHub mirror commit [1] corresponds to the SQLite Fossil check-in shown in [2].
[1] https://github.com/sqlite/sqlite/commit/d21bd37c7cfc1b85b17a6703555f0926b6236e04
[2] https://sqlite.org/src/info/6a9e1415659f9e75
Reference:
https://nvd.nist.gov/vuln/detail/CVE-2026-119378
--- .../sqlite/sqlite3/CVE-2026-119378.patch | 52 +++++++++++++++++++ meta/recipes-support/sqlite/sqlite3_3.45.3.bb | 1 + 2 files changed, 53 insertions(+) create mode 100644 meta/recipes-support/sqlite/sqlite3/CVE-2026-119378.patch
meta/recipes-support/sqlite/sqlite3/CVE-2026-119378.patch new file +52 -0
@@ -0,0 +1,52 @@ +From 347b0263ce597345446fcfd259d063ef86228191 Mon Sep 17 00:00:00 2001 +From: dan <Dan Kennedy> +Date: Thu, 24 Sep 2026 20:14:31 +0000 +Subject: [PATCH] Avoid a use-after-free problem in rtree triggered by an + attacker manipulating the shadow table schema to ensure + sqlite3_last_insert_rowid() returns 0 after certain INSERTs. Problem reported + by Claude and Ada Logics. + +FossilOrigin-Name: 6a9e1415659f9e75940b3c3a6f6e123f61c5e9e2a7a612693ee395d7b7567bef + +CVE: CVE-2026-119378 +Upstream-Status: Backport [https://github.com/sqlite/sqlite/commit/d21bd37c7cfc1b85b17a6703555f0926b6236e04] + +Backport Changes: +- Applied the ext/rtree/rtree.c fix to sqlite3.c because the recipe + source uses the amalgamated SQLite layout. +- Omitted ext/rtree/rtreeI.test because the extracted source does not + include the upstream test tree. +- Omitted manifest and manifest.uuid because they are Fossil + repository metadata and are not needed for this source patch. + +Signed-off-by: Arpit Patel <[email protected]> +--- + sqlite3.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/sqlite3.c b/sqlite3.c +index 62a8d5128b..4b1c310fd6 100644 +--- a/sqlite3.c ++++ b/sqlite3.c +@@ -209661,7 +209661,17 @@ static int nodeWrite(Rtree *pRtree, RtreeNode *pNode){ + sqlite3_bind_null(p, 2); + if( pNode->iNode==0 && rc==SQLITE_OK ){ + pNode->iNode = sqlite3_last_insert_rowid(pRtree->db); +- nodeHashInsert(pRtree, pNode); ++ if( pNode->iNode==0 ){ ++ /* If the SQL statement has succeeded but sqlite3_last_insert_rowid() ++ ** returns 0, then the shadow table schema has been corrupted somehow ++ ** (e.g. the %_node table has been replaced by a WITHOUT ROWID table). ++ ** It would be dangerous to continue in this case as the hash table ++ ** implementation assumes iNode==0 means that the node is not part ++ ** of the hash table. */ ++ rc = SQLITE_CORRUPT_VTAB; ++ }else{ ++ nodeHashInsert(pRtree, pNode); ++ } + } + } + return rc; +-- +2.35.6 +
meta/recipes-support/sqlite/sqlite3_3.45.3.bb +1 -0
@@ -19,6 +19,7 @@ SRC_URI = "http://www.sqlite.org/2024/sqlite-autoconf-${SQLITE_PV}.tar.gz \ file://CVE-2026-119375.patch \ file://CVE-2026-119379.patch \ file://CVE-2026-119372.patch \ + file://CVE-2026-119378.patch \ " SRC_URI[sha256sum] = "b2809ca53124c19c60f42bf627736eae011afdcc205bb48270a5ee9a38191531"
Signature · 1 line
2.35.6
PATCH 8/10 sqlite3: fix CVE-2026-119376
In reply to Arpit PatelThis patch applies the upstream fix [1], which includes COLLATE expressions in expression tree depth calculations and prevents bypass of the expression depth limit. The GitHub mirror commit [1] corresponds to the SQLite Fossil check-in shown in [2].
[1] https://github.com/sqlite/sqlite/commit/d54522a5b832422ab893a1e9fa7a99ab314ea4e2
[2] https://sqlite.org/src/info/252c0b7bf5a727d2
Reference:
https://nvd.nist.gov/vuln/detail/CVE-2026-119376
--- .../sqlite/sqlite3/CVE-2026-119376.patch | 75 +++++++++++++++++++ meta/recipes-support/sqlite/sqlite3_3.45.3.bb | 1 + 2 files changed, 76 insertions(+) create mode 100644 meta/recipes-support/sqlite/sqlite3/CVE-2026-119376.patch
meta/recipes-support/sqlite/sqlite3/CVE-2026-119376.patch new file +75 -0
@@ -0,0 +1,75 @@ +From 2af844923ba3e32fb16b06adab4e4ad3b2f4da49 Mon Sep 17 00:00:00 2001 +From: drh <> +Date: Sun, 4 Oct 2026 21:54:17 +0000 +Subject: [PATCH] Fix expression tree depth calculations for COLLATE. + [bugs:/info/2026-10-04T04:50:56Z|Bug 2026-10-04T04:50:56Z] + +FossilOrigin-Name: 252c0b7bf5a727d29605672bb58e06c758173c276671df3e388a68294998b4d3 + +CVE: CVE-2026-119376 +Upstream-Status: Backport [https://github.com/sqlite/sqlite/commit/d54522a5b832422ab893a1e9fa7a99ab314ea4e2] + +Backport Changes: +- Ported the src/expr.c and src/sqliteInt.h changes into sqlite3.c + because the recipe source uses the amalgamated SQLite layout. +- Omitted test/sqllimits1.test because the extracted source does not + include the upstream test tree. +- Omitted manifest and manifest.uuid because they are Fossil + repository metadata and are not needed for this source patch. + +Signed-off-by: Arpit Patel <[email protected]> +--- + sqlite3.c | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +diff --git a/sqlite3.c b/sqlite3.c +index 4b1c310fd6..7385344f84 100644 +--- a/sqlite3.c ++++ b/sqlite3.c +@@ -21204,8 +21204,8 @@ SQLITE_PRIVATE void sqlite3SetTextEncoding(sqlite3 *db, u8); + SQLITE_PRIVATE CollSeq *sqlite3ExprCollSeq(Parse *pParse, const Expr *pExpr); + SQLITE_PRIVATE CollSeq *sqlite3ExprNNCollSeq(Parse *pParse, const Expr *pExpr); + SQLITE_PRIVATE int sqlite3ExprCollSeqMatch(Parse*,const Expr*,const Expr*); +-SQLITE_PRIVATE Expr *sqlite3ExprAddCollateToken(const Parse *pParse, Expr*, const Token*, int); +-SQLITE_PRIVATE Expr *sqlite3ExprAddCollateString(const Parse*,Expr*,const char*); ++SQLITE_PRIVATE Expr *sqlite3ExprAddCollateToken(Parse *pParse, Expr*, const Token*, int); ++SQLITE_PRIVATE Expr *sqlite3ExprAddCollateString(Parse*,Expr*,const char*); + SQLITE_PRIVATE Expr *sqlite3ExprSkipCollate(Expr*); + SQLITE_PRIVATE Expr *sqlite3ExprSkipCollateAndLikely(Expr*); + SQLITE_PRIVATE int sqlite3CheckCollSeq(Parse *, CollSeq *); +@@ -108701,23 +108701,29 @@ SQLITE_PRIVATE int sqlite3ExprDataType(const Expr *pExpr){ + ** and the pExpr parameter is returned unchanged. + */ + SQLITE_PRIVATE Expr *sqlite3ExprAddCollateToken( +- const Parse *pParse, /* Parsing context */ ++ Parse *pParse, /* Parsing context */ + Expr *pExpr, /* Add the "COLLATE" clause to this expression */ + const Token *pCollName, /* Name of collating sequence */ + int dequote /* True to dequote pCollName */ + ){ +- if( pCollName->n>0 ){ ++ if( pCollName->n>0 && pParse->nErr==0 ){ + Expr *pNew = sqlite3ExprAlloc(pParse->db, TK_COLLATE, pCollName, dequote); ++ assert( pExpr!=0 ); + if( pNew ){ + pNew->pLeft = pExpr; + pNew->flags |= EP_Collate|EP_Skip; ++#if SQLITE_MAX_EXPR_DEPTH>0 ++ pNew->nHeight = pExpr->nHeight+1; ++ sqlite3ExprCheckHeight(pParse, pNew->nHeight); ++ testcase( pParse->nErr>0 ); ++#endif + pExpr = pNew; + } + } + return pExpr; + } + SQLITE_PRIVATE Expr *sqlite3ExprAddCollateString( +- const Parse *pParse, /* Parsing context */ ++ Parse *pParse, /* Parsing context */ + Expr *pExpr, /* Add the "COLLATE" clause to this expression */ + const char *zC /* The collating sequence name */ + ){ +-- +2.35.6 +
meta/recipes-support/sqlite/sqlite3_3.45.3.bb +1 -0
@@ -20,6 +20,7 @@ SRC_URI = "http://www.sqlite.org/2024/sqlite-autoconf-${SQLITE_PV}.tar.gz \ file://CVE-2026-119379.patch \ file://CVE-2026-119372.patch \ file://CVE-2026-119378.patch \ + file://CVE-2026-119376.patch \ " SRC_URI[sha256sum] = "b2809ca53124c19c60f42bf627736eae011afdcc205bb48270a5ee9a38191531"
Signature · 1 line
2.35.6
PATCH 9/10 sqlite3: fix CVE-2026-119371
In reply to Arpit PatelThis patch series applies the upstream prerequisite [1] and CTE recursion fix [3]. Commit [1] adds VIEW and subquery nesting tracking; commit [3] uses that counter to limit recursive CTE depth. The GitHub commits [1] and [3] correspond to SQLite Fossil check-ins [2] and [4], respectively.
[1] https://github.com/sqlite/sqlite/commit/9fb225190c3ac0e51f11a7fddab0d4cc960417ad
[2] https://sqlite.org/src/info/3f3fb9b638f59ad9
[3] https://github.com/sqlite/sqlite/commit/e6ff280c839fdfc7418fd5add12e8f32702a17fb
[4] https://sqlite.org/src/info/f54730871303e655
Reference:
https://nvd.nist.gov/vuln/detail/CVE-2026-119371
--- .../sqlite3/CVE-2026-119371-dependent.patch | 109 ++++++++++++++++++ .../sqlite/sqlite3/CVE-2026-119371.patch | 104 +++++++++++++++++ meta/recipes-support/sqlite/sqlite3_3.45.3.bb | 2 + 3 files changed, 215 insertions(+) create mode 100644 meta/recipes-support/sqlite/sqlite3/CVE-2026-119371-dependent.patch create mode 100644 meta/recipes-support/sqlite/sqlite3/CVE-2026-119371.patch
meta/recipes-support/sqlite/sqlite3/CVE-2026-119371-dependent.patch new file +109 -0
@@ -0,0 +1,109 @@ +From fcea662407384de099367f4eded9dae4ac16b7eb Mon Sep 17 00:00:00 2001 +From: drh <> +Date: Tue, 16 Jun 2026 13:43:08 +0000 +Subject: [PATCH] Limit VIEW recursion depth to SQLITE_LIMIT_EXPR_DEPTH to + prevent static overflow in malicious schemas with tens of thousands of levels + of recursive views. [bugs:/info/2026-06-16T04:21:51Z|Bug + 2026-06-16T04:21:51Z] + +FossilOrigin-Name: 3f3fb9b638f59ad982beafb7c117f24ddd3da612e62c862510805fa672ffae06 + +CVE: CVE-2026-119371 +Upstream-Status: Backport [https://github.com/sqlite/sqlite/commit/9fb225190c3ac0e51f11a7fddab0d4cc960417ad] + +Backport Changes: +- Ported src/select.c and src/sqliteInt.h code into the amalgamated + sqlite3.c source file. +- Updated limit documentation in sqlite3.c and sqlite3.h. +- Omitted test/view.test because the extracted source lacks the upstream + test tree. +- Omitted manifest and manifest.uuid because they are Fossil metadata. + +Signed-off-by: Arpit Patel <[email protected]> +--- + sqlite3.c | 16 ++++++++++++++-- + sqlite3.h | 6 ++++-- + 2 files changed, 18 insertions(+), 4 deletions(-) + +diff --git a/sqlite3.c b/sqlite3.c +index 7385344f84..13c687dde4 100644 +--- a/sqlite3.c ++++ b/sqlite3.c +@@ -4418,7 +4418,8 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); + ** or in an ORDER BY or GROUP BY clause.</dd>)^ + ** + ** [[SQLITE_LIMIT_EXPR_DEPTH]] ^(<dt>SQLITE_LIMIT_EXPR_DEPTH</dt> +-** <dd>The maximum depth of the parse tree on any expression.</dd>)^ ++** <dd>The maximum depth of the parse tree on any expression and ++** the maximum nesting depth for subqueries and VIEWs</dd>)^ + ** + ** [[SQLITE_LIMIT_COMPOUND_SELECT]] ^(<dt>SQLITE_LIMIT_COMPOUND_SELECT</dt> + ** <dd>The maximum number of terms in a compound SELECT statement.</dd>)^ +@@ -4445,7 +4446,8 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); + ** <dd>The maximum index number of any [parameter] in an SQL statement.)^ + ** + ** [[SQLITE_LIMIT_TRIGGER_DEPTH]] ^(<dt>SQLITE_LIMIT_TRIGGER_DEPTH</dt> +-** <dd>The maximum depth of recursion for triggers.</dd>)^ ++** <dd>The maximum depth of recursion for triggers, and the maximum ++** nesting depth for separate triggers.</dd>)^ + ** + ** [[SQLITE_LIMIT_WORKER_THREADS]] ^(<dt>SQLITE_LIMIT_WORKER_THREADS</dt> + ** <dd>The maximum number of auxiliary worker threads that a single +@@ -19755,6 +19757,7 @@ struct Parse { + int szOpAlloc; /* Bytes of memory space allocated for Vdbe.aOp[] */ + int iSelfTab; /* Table associated with an index on expr, or negative + ** of the base register during check-constraint eval */ ++ int nNestSel; /* Number of nested SELECT statements and/or VIEWs */ + int nLabel; /* The *negative* of the number of labels used */ + int nLabelAlloc; /* Number of slots in aLabel */ + int *aLabel; /* Space to hold the labels */ +@@ -144384,6 +144387,13 @@ SQLITE_PRIVATE Table *sqlite3ResultSetOfSelect(Parse *pParse, Select *pSelect, c + sqlite3 *db = pParse->db; + u64 savedFlags; + ++ pParse->nNestSel++; ++#if SQLITE_MAX_EXPR_DEPTH>0 ++ if( pParse->nNestSel >= db->aLimit[SQLITE_LIMIT_EXPR_DEPTH] ){ ++ sqlite3ErrorMsg(pParse, "VIEWs and/or subqueries nested too deep"); ++ return 0; ++ } ++#endif + savedFlags = db->flags; + db->flags &= ~(u64)SQLITE_FullColNames; + db->flags |= SQLITE_ShortColNames; +@@ -144405,6 +144415,8 @@ SQLITE_PRIVATE Table *sqlite3ResultSetOfSelect(Parse *pParse, Select *pSelect, c + sqlite3DeleteTable(db, pTab); + return 0; + } ++ pParse->nNestSel--; ++ assert( pParse->nNestSel>=0 ); + return pTab; + } + +diff --git a/sqlite3.h b/sqlite3.h +index 056511f577..705217e7ff 100644 +--- a/sqlite3.h ++++ b/sqlite3.h +@@ -4127,7 +4127,8 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); + ** or in an ORDER BY or GROUP BY clause.</dd>)^ + ** + ** [[SQLITE_LIMIT_EXPR_DEPTH]] ^(<dt>SQLITE_LIMIT_EXPR_DEPTH</dt> +-** <dd>The maximum depth of the parse tree on any expression.</dd>)^ ++** <dd>The maximum depth of the parse tree on any expression and ++** the maximum nesting depth for subqueries and VIEWs</dd>)^ + ** + ** [[SQLITE_LIMIT_COMPOUND_SELECT]] ^(<dt>SQLITE_LIMIT_COMPOUND_SELECT</dt> + ** <dd>The maximum number of terms in a compound SELECT statement.</dd>)^ +@@ -4154,7 +4155,8 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); + ** <dd>The maximum index number of any [parameter] in an SQL statement.)^ + ** + ** [[SQLITE_LIMIT_TRIGGER_DEPTH]] ^(<dt>SQLITE_LIMIT_TRIGGER_DEPTH</dt> +-** <dd>The maximum depth of recursion for triggers.</dd>)^ ++** <dd>The maximum depth of recursion for triggers, and the maximum ++** nesting depth for separate triggers.</dd>)^ + ** + ** [[SQLITE_LIMIT_WORKER_THREADS]] ^(<dt>SQLITE_LIMIT_WORKER_THREADS</dt> + ** <dd>The maximum number of auxiliary worker threads that a single +-- +2.35.6 +
meta/recipes-support/sqlite/sqlite3/CVE-2026-119371.patch new file +104 -0
104 lines not on this page · raw message
meta/recipes-support/sqlite/sqlite3_3.45.3.bb +2 -0
@@ -21,6 +21,8 @@ SRC_URI = "http://www.sqlite.org/2024/sqlite-autoconf-${SQLITE_PV}.tar.gz \ file://CVE-2026-119372.patch \ file://CVE-2026-119378.patch \ file://CVE-2026-119376.patch \ + file://CVE-2026-119371-dependent.patch \ + file://CVE-2026-119371.patch \ " SRC_URI[sha256sum] = "b2809ca53124c19c60f42bf627736eae011afdcc205bb48270a5ee9a38191531"
Signature · 1 line
2.35.6
PATCH 10/10 sqlite3: fix CVE-2026-119591
In reply to Arpit PatelThis patch applies the upstream fix [1] for stack exhaustion in the count-of-view optimization. The GitHub mirror commit [1] corresponds to the SQLite Fossil check-in shown in [2].
[1] https://github.com/sqlite/sqlite/commit/eff50a067c55f972909e7780e506e91382d08de2
[2] https://sqlite.org/src/info/ab621a3e11ee4acc
Reference:
https://nvd.nist.gov/vuln/detail/CVE-2026-119591
--- .../sqlite/sqlite3/CVE-2026-119591.patch | 40 +++++++++++++++++++ meta/recipes-support/sqlite/sqlite3_3.45.3.bb | 1 + 2 files changed, 41 insertions(+) create mode 100644 meta/recipes-support/sqlite/sqlite3/CVE-2026-119591.patch
meta/recipes-support/sqlite/sqlite3/CVE-2026-119591.patch new file +40 -0
@@ -0,0 +1,40 @@ +From 5dbe255431ad2b935db31e8e3c2c66284e2709ef Mon Sep 17 00:00:00 2001 +From: drh <> +Date: Mon, 5 Oct 2026 12:18:23 +0000 +Subject: [PATCH] Prevent the expression generated by the count-of-view + optimization from getting too deep and causing a CPU stack overflow. + [bugs:/info/2026-10-04T05:34:47Z|Bug 2026-10-04T05:34:47Z] + +FossilOrigin-Name: ab621a3e11ee4accce14bf6c90a7cc273d9c25a7c3d9dd2466f2bdc2bbbf8084 + +CVE: CVE-2026-119591 +Upstream-Status: Backport [https://github.com/sqlite/sqlite/commit/eff50a067c55f972909e7780e506e91382d08de2] + +Backport Changes: +- Ported the src/select.c change into the amalgamated sqlite3.c. +- Omitted manifest and manifest.uuid because they are Fossil metadata + and are not needed for this source layout. + +Signed-off-by: Arpit Patel <[email protected]> +--- + sqlite3.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/sqlite3.c b/sqlite3.c +index 27b3bff8ea..788e23a839 100644 +--- a/sqlite3.c ++++ b/sqlite3.c +@@ -149172,6 +149172,10 @@ static int countOfViewOptimization(Parse *pParse, Select *p){ + }else{ + pExpr = sqlite3PExpr(pParse, TK_PLUS, pTerm, pExpr); + } ++ if( pParse->nErr ){ ++ sqlite3ExprDelete(db, pExpr); ++ pExpr = 0; ++ } + pSub = pPrior; + } + p->pEList->a[0].pExpr = pExpr; +-- +2.35.6 +
meta/recipes-support/sqlite/sqlite3_3.45.3.bb +1 -0
@@ -23,6 +23,7 @@ SRC_URI = "http://www.sqlite.org/2024/sqlite-autoconf-${SQLITE_PV}.tar.gz \ file://CVE-2026-119376.patch \ file://CVE-2026-119371-dependent.patch \ file://CVE-2026-119371.patch \ + file://CVE-2026-119591.patch \ " SRC_URI[sha256sum] = "b2809ca53124c19c60f42bf627736eae011afdcc205bb48270a5ee9a38191531"
Signature · 1 line
2.35.6