Skip to contentSkip to conversation

sqlite3: Fix CVE-2025-70873

PATCH In review [email protected] 2 participants 6 messages Apr 2 – Apr 5

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sqlite3: Fix CVE-2025-70873

From: Vijay Anusuri <[email protected]>

Pick patch as per [1]

[1] https://sqlite.org/src/info/3d459f1fb1bd1b5e
[2] https://sqlite.org/forum/forumpost/761eac3c82
[3] https://gist.github.com/cnwangjihe/f496393f30f5ecec5b18c8f5ab072054

---
 .../sqlite/files/CVE-2025-70873.patch         | 33 +++++++++++++++++++
 meta/recipes-support/sqlite/sqlite3_3.38.5.bb |  1 +
 2 files changed, 34 insertions(+)
 create mode 100644 meta/recipes-support/sqlite/files/CVE-2025-70873.patch
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +33 -0
new file mode 100644
index 0000000000..86004c0b74
@@ -0,0 +1,33 @@
+From 5a05c59d4d75c03f23d5fb70feac9f789954bf8a Mon Sep 17 00:00:00 2001
+From: drh <>
+Date: Sat, 6 Dec 2025 20:41:24 +0000
+Subject: [PATCH] In the zipfile extension, only return as many bytes as
+ Inflate actually generated.  [forum:/forumpost/761eac3c82|Forum post
+ 761eac3c82]. Adjust ./configure so that it builds zipfile into testfixture if
+ ZLIB is available, so that tests get run on unix platforms.
+
+FossilOrigin-Name: 3d459f1fb1bd1b5e723629c463ab392af7b206ece3388bda216c6a4c26160909
+
+Upstream-Status: Backport [https://github.com/sqlite/sqlite/commit/5a05c59d4d75c03f23d5fb70feac9f789954bf8a]
+CVE: CVE-2025-70873
+Signed-off-by: Vijay Anusuri <[email protected]>
+---
+ shell.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/shell.c b/shell.c
+index fa45d40..3c4902c 100644
+--- a/shell.c
++++ b/shell.c
+@@ -7668,7 +7668,7 @@ static void zipfileInflate(
+       if( err!=Z_STREAM_END ){
+         zipfileCtxErrorMsg(pCtx, "inflate() failed (%d)", err);
+       }else{
+-        sqlite3_result_blob(pCtx, aRes, nOut, zipfileFree);
++        sqlite3_result_blob(pCtx, aRes, (int)str.total_out, zipfileFree);
+         aRes = 0;
+       }
+     }
+-- 
+2.25.1
+
meta/recipes-support/sqlite/sqlite3_3.38.5.bb +1 -0
index acdd80022e..9e10caa399 100644
@@ -10,6 +10,7 @@ SRC_URI = "http://www.sqlite.org/2022/sqlite-autoconf-${SQLITE_PV}.tar.gz \
            file://CVE-2023-7104.patch \
            file://CVE-2025-29088.patch \
            file://CVE-2025-6965.patch \
+           file://CVE-2025-70873.patch \
            "
 SRC_URI[sha256sum] = "5af07de982ba658fd91a03170c945f99c971f6955bc79df3266544373e39869c"
 
Signature · 1 line
2.25.1
#1 lore raw
Quoted 10 lines · Vijay Anusuri via lists.openembedded.org

From: Vijay Anusuri <[email protected]>

Pick patch as per [1]

[1] https://sqlite.org/src/info/3d459f1fb1bd1b5e
[2] https://sqlite.org/forum/forumpost/761eac3c82
[3] https://gist.github.com/cnwangjihe/f496393f30f5ecec5b18c8f5ab072054

---

Hello,

As far as I can tell, this CVE applies to master. Since this is the end of kirkstone soon, I'll take it into the reviews series but can only merge it if there is a patch sent for this CVE in those branches.

Regards,

Quoted 56 lines
 .../sqlite/files/CVE-2025-70873.patch         | 33 +++++++++++++++++++
 meta/recipes-support/sqlite/sqlite3_3.38.5.bb |  1 +
 2 files changed, 34 insertions(+)
 create mode 100644 meta/recipes-support/sqlite/files/CVE-2025-70873.patch
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +33 -0
new file mode 100644
index 0000000000..86004c0b74
@@ -0,0 +1,33 @@
+From 5a05c59d4d75c03f23d5fb70feac9f789954bf8a Mon Sep 17 00:00:00 2001
+From: drh <>
+Date: Sat, 6 Dec 2025 20:41:24 +0000
+Subject: [PATCH] In the zipfile extension, only return as many bytes as
+ Inflate actually generated.  [forum:/forumpost/761eac3c82|Forum post
+ 761eac3c82]. Adjust ./configure so that it builds zipfile into testfixture if
+ ZLIB is available, so that tests get run on unix platforms.
+
+FossilOrigin-Name: 3d459f1fb1bd1b5e723629c463ab392af7b206ece3388bda216c6a4c26160909
+
+Upstream-Status: Backport [https://github.com/sqlite/sqlite/commit/5a05c59d4d75c03f23d5fb70feac9f789954bf8a]
+CVE: CVE-2025-70873
+Signed-off-by: Vijay Anusuri <[email protected]>
+---
+ shell.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/shell.c b/shell.c
+index fa45d40..3c4902c 100644
+--- a/shell.c
++++ b/shell.c
+@@ -7668,7 +7668,7 @@ static void zipfileInflate(
+       if( err!=Z_STREAM_END ){
+         zipfileCtxErrorMsg(pCtx, "inflate() failed (%d)", err);
+       }else{
+-        sqlite3_result_blob(pCtx, aRes, nOut, zipfileFree);
++        sqlite3_result_blob(pCtx, aRes, (int)str.total_out, zipfileFree);
+         aRes = 0;
+       }
+     }
+-- 
+2.25.1
+
meta/recipes-support/sqlite/sqlite3_3.38.5.bb +1 -0
index acdd80022e..9e10caa399 100644
@@ -10,6 +10,7 @@ SRC_URI = "http://www.sqlite.org/2022/sqlite-autoconf-${SQLITE_PV}.tar.gz \
            file://CVE-2023-7104.patch \
            file://CVE-2025-29088.patch \
            file://CVE-2025-6965.patch \
+           file://CVE-2025-70873.patch \
            "
 SRC_URI[sha256sum] = "5af07de982ba658fd91a03170c945f99c971f6955bc79df3266544373e39869c"
 
Signature · 2 lines
Yoann Congal
Smile ECS
#2 lore raw

Hi Yoann,

The fixes for this CVE are already included in SQLite version 3.51.3 on the master branch.

I’ve already submitted backport patches for the whinlatter and scarthgap branches. Please let me know if anything further is needed.

Thanks & Regards,

Vijay

Quoted 94 lines · Yoann Congal
Quoted 10 lines · Vijay Anusuri via lists.openembedded.org

From: Vijay Anusuri <[email protected]>

Pick patch as per [1]

[1] https://sqlite.org/src/info/3d459f1fb1bd1b5e
[2] https://sqlite.org/forum/forumpost/761eac3c82
[3] https://gist.github.com/cnwangjihe/f496393f30f5ecec5b18c8f5ab072054

---

Hello,

As far as I can tell, this CVE applies to master. Since this is the end of kirkstone soon, I'll take it into the reviews series but can only merge it if there is a patch sent for this CVE in those branches.

Regards,

Quoted 4 lines
 .../sqlite/files/CVE-2025-70873.patch         | 33 +++++++++++++++++++
 meta/recipes-support/sqlite/sqlite3_3.38.5.bb |  1 +
 2 files changed, 34 insertions(+)
 create mode 100644

meta/recipes-support/sqlite/files/CVE-2025-70873.patch

Review

Quoted 2 lines
(quoted diff) +0 -0

b/meta/recipes-support/sqlite/files/CVE-2025-70873.patch

meta/recipes-support/sqlite/files/CVE-2025-70873.patch line 6

Quoted 11 lines

new file mode 100644
index 0000000000..86004c0b74

meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +6 -0
@@ -0,0 +1,33 @@
+From 5a05c59d4d75c03f23d5fb70feac9f789954bf8a Mon Sep 17 00:00:00 2001
+From: drh <>
+Date: Sat, 6 Dec 2025 20:41:24 +0000
+Subject: [PATCH] In the zipfile extension, only return as many bytes as
+ Inflate actually generated.  [forum:/forumpost/761eac3c82|Forum post
+ 761eac3c82]. Adjust ./configure so that it builds zipfile into

testfixture if

meta/recipes-support/sqlite/files/CVE-2025-70873.patch

Quoted 3 lines
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +3 -0
+ ZLIB is available, so that tests get run on unix platforms.
+
+FossilOrigin-Name:

3d459f1fb1bd1b5e723629c463ab392af7b206ece3388bda216c6a4c26160909

meta/recipes-support/sqlite/files/CVE-2025-70873.patch line 11

Quoted 2 lines
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +2 -0
+
+Upstream-Status: Backport [

https://github.com/sqlite/sqlite/commit/5a05c59d4d75c03f23d5fb70feac9f789954bf8a
]

Quoted 6 lines
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +6 -0
+CVE: CVE-2025-70873
+Signed-off-by: Vijay Anusuri <[email protected]>
+---
+ shell.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+

meta/recipes-support/sqlite/files/CVE-2025-70873.patch

Quoted 10 lines
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +10 -0
+diff --git a/shell.c b/shell.c
+index fa45d40..3c4902c 100644
+--- a/shell.c
++++ b/shell.c
+@@ -7668,7 +7668,7 @@ static void zipfileInflate(
+       if( err!=Z_STREAM_END ){
+         zipfileCtxErrorMsg(pCtx, "inflate() failed (%d)", err);
+       }else{
+-        sqlite3_result_blob(pCtx, aRes, nOut, zipfileFree);
++        sqlite3_result_blob(pCtx, aRes, (int)str.total_out,

zipfileFree);

Review

Quoted 7 lines
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +6 -0
+         aRes = 0;
+       }
+     }
+--
+2.25.1
+
(quoted diff) +0 -0

b/meta/recipes-support/sqlite/sqlite3_3.38.5.bb

meta/recipes-support/sqlite/sqlite3_3.38.5.bb SRC_URI = "

Quoted 4 lines

index acdd80022e..9e10caa399 100644

meta/recipes-support/sqlite/sqlite3_3.38.5.bb +0 -0
@@ -10,6 +10,7 @@ SRC_URI = "

http://www.sqlite.org/2022/sqlite-autoconf-${SQLITE_PV}.tar.gz \

meta/recipes-support/sqlite/sqlite3_3.38.5.bb SRC_URI = "http://www.sqlite.org/2022/sqlite-autoconf-${SQLITE_PV}.tar.gz \

Quoted 6 lines
meta/recipes-support/sqlite/sqlite3_3.38.5.bb +1 -0
            file://CVE-2023-7104.patch \
            file://CVE-2025-29088.patch \
            file://CVE-2025-6965.patch \
+           file://CVE-2025-70873.patch \
            "
 SRC_URI[sha256sum] =

"5af07de982ba658fd91a03170c945f99c971f6955bc79df3266544373e39869c"

Quoted 1 line

--
Yoann Congal
Smile ECS

#3 lore raw
Quoted 4 lines · Vijay Anusuri

Hi Yoann,

The fixes for this CVE are already included in SQLite version 3.51.3 on the master branch.

Can you tell me what commit does fix this CVE on the 3.51.3 tag? I don't see it.

Regards,

Quoted 104 lines

I’ve already submitted backport patches for the whinlatter and scarthgap branches. Please let me know if anything further is needed.

Thanks & Regards,

Vijay

Quoted 94 lines · Yoann Congal
Quoted 10 lines · Vijay Anusuri via lists.openembedded.org

From: Vijay Anusuri <[email protected]>

Pick patch as per [1]

[1] https://sqlite.org/src/info/3d459f1fb1bd1b5e
[2] https://sqlite.org/forum/forumpost/761eac3c82
[3] https://gist.github.com/cnwangjihe/f496393f30f5ecec5b18c8f5ab072054

---

Hello,

As far as I can tell, this CVE applies to master. Since this is the end of kirkstone soon, I'll take it into the reviews series but can only merge it if there is a patch sent for this CVE in those branches.

Regards,

Quoted 4 lines
 .../sqlite/files/CVE-2025-70873.patch         | 33 +++++++++++++++++++
 meta/recipes-support/sqlite/sqlite3_3.38.5.bb |  1 +
 2 files changed, 34 insertions(+)
 create mode 100644

meta/recipes-support/sqlite/files/CVE-2025-70873.patch

Review

Quoted 2 lines
(quoted diff) +0 -0

b/meta/recipes-support/sqlite/files/CVE-2025-70873.patch

meta/recipes-support/sqlite/files/CVE-2025-70873.patch line 6

Quoted 11 lines

new file mode 100644
index 0000000000..86004c0b74

meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +6 -0
@@ -0,0 +1,33 @@
+From 5a05c59d4d75c03f23d5fb70feac9f789954bf8a Mon Sep 17 00:00:00 2001
+From: drh <>
+Date: Sat, 6 Dec 2025 20:41:24 +0000
+Subject: [PATCH] In the zipfile extension, only return as many bytes as
+ Inflate actually generated.  [forum:/forumpost/761eac3c82|Forum post
+ 761eac3c82]. Adjust ./configure so that it builds zipfile into

testfixture if

meta/recipes-support/sqlite/files/CVE-2025-70873.patch

Quoted 3 lines
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +3 -0
+ ZLIB is available, so that tests get run on unix platforms.
+
+FossilOrigin-Name:

3d459f1fb1bd1b5e723629c463ab392af7b206ece3388bda216c6a4c26160909

meta/recipes-support/sqlite/files/CVE-2025-70873.patch line 11

Quoted 2 lines
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +2 -0
+
+Upstream-Status: Backport [

https://github.com/sqlite/sqlite/commit/5a05c59d4d75c03f23d5fb70feac9f789954bf8a
]

Quoted 6 lines
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +6 -0
+CVE: CVE-2025-70873
+Signed-off-by: Vijay Anusuri <[email protected]>
+---
+ shell.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+

meta/recipes-support/sqlite/files/CVE-2025-70873.patch

Quoted 10 lines
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +10 -0
+diff --git a/shell.c b/shell.c
+index fa45d40..3c4902c 100644
+--- a/shell.c
++++ b/shell.c
+@@ -7668,7 +7668,7 @@ static void zipfileInflate(
+       if( err!=Z_STREAM_END ){
+         zipfileCtxErrorMsg(pCtx, "inflate() failed (%d)", err);
+       }else{
+-        sqlite3_result_blob(pCtx, aRes, nOut, zipfileFree);
++        sqlite3_result_blob(pCtx, aRes, (int)str.total_out,

zipfileFree);

Review

Quoted 7 lines
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +6 -0
+         aRes = 0;
+       }
+     }
+--
+2.25.1
+
(quoted diff) +0 -0

b/meta/recipes-support/sqlite/sqlite3_3.38.5.bb

meta/recipes-support/sqlite/sqlite3_3.38.5.bb SRC_URI = "

Quoted 4 lines

index acdd80022e..9e10caa399 100644

meta/recipes-support/sqlite/sqlite3_3.38.5.bb +0 -0
@@ -10,6 +10,7 @@ SRC_URI = "

http://www.sqlite.org/2022/sqlite-autoconf-${SQLITE_PV}.tar.gz \

meta/recipes-support/sqlite/sqlite3_3.38.5.bb SRC_URI = "http://www.sqlite.org/2022/sqlite-autoconf-${SQLITE_PV}.tar.gz \

Quoted 6 lines
meta/recipes-support/sqlite/sqlite3_3.38.5.bb +1 -0
            file://CVE-2023-7104.patch \
            file://CVE-2025-29088.patch \
            file://CVE-2025-6965.patch \
+           file://CVE-2025-70873.patch \
            "
 SRC_URI[sha256sum] =

"5af07de982ba658fd91a03170c945f99c971f6955bc79df3266544373e39869c"

Quoted 1 line

--
Yoann Congal
Smile ECS

Signature · 2 lines
Yoann Congal
Smile ECS
#4 lore raw

Hi Yoann,

Thanks for checking.

From what I could verify, the issue affects SQLite versions with the zipfile extension up to 3.51.1. The upstream fix appears to originate from commit https://sqlite.org/src/info/3d459f1fb1bd1b5e (as referenced in the SQLite tracker and forum discussion).

https://gist.github.com/cnwangjihe/f496393f30f5ecec5b18c8f5ab072054

https://sqlite.org/forum/forumpost/761eac3c82

In the 3.51.3 tag, the fix seems to be included as part of a larger upstream commit
(https://github.com/sqlite/sqlite/commit/15cd6704863f7c68818b2d607191ab6944d39f98),
which bundles multiple changes together rather than isolating the CVE fix in a single minimal patch. That likely explains why it’s not immediately obvious when looking for a one-to-one commit reference.

So while there isn’t a standalone CVE-specific commit in 3.51.3, the fix is incorporated there as part of that broader change set.

Thanks & Regards,

Vijay

Quoted 129 lines · Yoann Congal
Quoted 3 lines · Vijay Anusuri

Hi Yoann,

The fixes for this CVE are already included in SQLite version 3.51.3 on

the

Quoted 1 line

master branch.

Can you tell me what commit does fix this CVE on the 3.51.3 tag? I don't see it.

Regards,

Quoted 9 lines

I’ve already submitted backport patches for the whinlatter and scarthgap branches. Please let me know if anything further is needed.

Thanks & Regards,

Vijay

On Sat, Apr 4, 2026 at 4:23 AM Yoann Congal <[email protected]>

Quoted 10 lines · wrote:
Quoted 10 lines
Quoted 7 lines · Vijay Anusuri via lists.openembedded.org

From: Vijay Anusuri <[email protected]>

Pick patch as per [1]

[1] https://sqlite.org/src/info/3d459f1fb1bd1b5e
[2] https://sqlite.org/forum/forumpost/761eac3c82
[3]

https://gist.github.com/cnwangjihe/f496393f30f5ecec5b18c8f5ab072054

Quoted 6 lines
Quoted 6 lines
Quoted 3 lines

---

Hello,

Quoted 7 lines
Quoted 7 lines

As far as I can tell, this CVE applies to master. Since this is the end of kirkstone soon, I'll take it into the reviews series but can only merge it if there is a patch sent for this CVE in those branches.

Regards,

Quoted 1 line
 .../sqlite/files/CVE-2025-70873.patch         | 33

+++++++++++++++++++

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
 meta/recipes-support/sqlite/sqlite3_3.38.5.bb |  1 +
 2 files changed, 34 insertions(+)
 create mode 100644

meta/recipes-support/sqlite/files/CVE-2025-70873.patch

Quoted 1 line
Quoted 8 lines
Quoted 8 lines

Review

Quoted 1 line
(quoted diff) +0 -0

b/meta/recipes-support/sqlite/files/CVE-2025-70873.patch

meta/recipes-support/sqlite/files/CVE-2025-70873.patch line 1

Quoted 6 lines

new file mode 100644
index 0000000000..86004c0b74

meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +1 -0
@@ -0,0 +1,33 @@
+From 5a05c59d4d75c03f23d5fb70feac9f789954bf8a Mon Sep 17 00:00:00

2001

Quoted 3 lines
Quoted 3 lines

meta/recipes-support/sqlite/files/CVE-2025-70873.patch

Quoted 3 lines
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +3 -0
+From: drh <>
+Date: Sat, 6 Dec 2025 20:41:24 +0000
+Subject: [PATCH] In the zipfile extension, only return as many bytes

as

Quoted 10 lines
Quoted 10 lines

meta/recipes-support/sqlite/files/CVE-2025-70873.patch line 6

Quoted 2 lines
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +2 -0
+ Inflate actually generated.  [forum:/forumpost/761eac3c82|Forum post
+ 761eac3c82]. Adjust ./configure so that it builds zipfile into

testfixture if

meta/recipes-support/sqlite/files/CVE-2025-70873.patch

Quoted 3 lines
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +3 -0
+ ZLIB is available, so that tests get run on unix platforms.
+
+FossilOrigin-Name:

3d459f1fb1bd1b5e723629c463ab392af7b206ece3388bda216c6a4c26160909

meta/recipes-support/sqlite/files/CVE-2025-70873.patch line 11

Quoted 2 lines
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +2 -0
+
+Upstream-Status: Backport [

https://github.com/sqlite/sqlite/commit/5a05c59d4d75c03f23d5fb70feac9f789954bf8a

Quoted 41 lines
Quoted 41 lines

]

Quoted 6 lines
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +6 -0
+CVE: CVE-2025-70873
+Signed-off-by: Vijay Anusuri <[email protected]>
+---
+ shell.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+

meta/recipes-support/sqlite/files/CVE-2025-70873.patch

Quoted 10 lines
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +10 -0
+diff --git a/shell.c b/shell.c
+index fa45d40..3c4902c 100644
+--- a/shell.c
++++ b/shell.c
+@@ -7668,7 +7668,7 @@ static void zipfileInflate(
+       if( err!=Z_STREAM_END ){
+         zipfileCtxErrorMsg(pCtx, "inflate() failed (%d)", err);
+       }else{
+-        sqlite3_result_blob(pCtx, aRes, nOut, zipfileFree);
++        sqlite3_result_blob(pCtx, aRes, (int)str.total_out,

zipfileFree);

Review

Quoted 7 lines
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +6 -0
+         aRes = 0;
+       }
+     }
+--
+2.25.1
+
(quoted diff) +0 -0

b/meta/recipes-support/sqlite/sqlite3_3.38.5.bb

meta/recipes-support/sqlite/sqlite3_3.38.5.bb SRC_URI = "

Quoted 4 lines

index acdd80022e..9e10caa399 100644

meta/recipes-support/sqlite/sqlite3_3.38.5.bb +0 -0
@@ -10,6 +10,7 @@ SRC_URI = "

http://www.sqlite.org/2022/sqlite-autoconf-${SQLITE_PV}.tar.gz \

meta/recipes-support/sqlite/sqlite3_3.38.5.bb SRC_URI = "http://www.sqlite.org/2022/sqlite-autoconf-${SQLITE_PV}.tar.gz \

Quoted 6 lines
meta/recipes-support/sqlite/sqlite3_3.38.5.bb +1 -0
            file://CVE-2023-7104.patch \
            file://CVE-2025-29088.patch \
            file://CVE-2025-6965.patch \
+           file://CVE-2025-70873.patch \
            "
 SRC_URI[sha256sum] =

"5af07de982ba658fd91a03170c945f99c971f6955bc79df3266544373e39869c"

Quoted 1 line
Quoted 5 lines
Quoted 5 lines

--
Yoann Congal
Smile ECS

--
Yoann Congal
Smile ECS

#5 lore raw
Quoted 20 lines · Vijay Anusuri

Hi Yoann,

Thanks for checking.

From what I could verify, the issue affects SQLite versions with the zipfile extension up to 3.51.1. The upstream fix appears to originate from commit https://sqlite.org/src/info/3d459f1fb1bd1b5e (as referenced in the SQLite tracker and forum discussion).

https://gist.github.com/cnwangjihe/f496393f30f5ecec5b18c8f5ab072054

https://sqlite.org/forum/forumpost/761eac3c82

In the 3.51.3 tag, the fix seems to be included as part of a larger upstream commit
(https://github.com/sqlite/sqlite/commit/15cd6704863f7c68818b2d607191ab6944d39f98),
which bundles multiple changes together rather than isolating the CVE fix in a single minimal patch. That likely explains why it’s not immediately obvious when looking for a one-to-one commit reference.

Quoted 2 lines

So while there isn’t a standalone CVE-specific commit in 3.51.3, the fix is incorporated there as part of that broader change set.

Ok, thanks for the details, I agree: oe-core master is fixed.

Regards,

Quoted 139 lines

Thanks & Regards,

Vijay

Quoted 129 lines · Yoann Congal
Quoted 3 lines · Vijay Anusuri

Hi Yoann,

The fixes for this CVE are already included in SQLite version 3.51.3 on

the

Quoted 1 line

master branch.

Can you tell me what commit does fix this CVE on the 3.51.3 tag? I don't see it.

Regards,

Quoted 9 lines

I’ve already submitted backport patches for the whinlatter and scarthgap branches. Please let me know if anything further is needed.

Thanks & Regards,

Vijay

On Sat, Apr 4, 2026 at 4:23 AM Yoann Congal <[email protected]>

Quoted 10 lines · wrote:
Quoted 10 lines
Quoted 7 lines · Vijay Anusuri via lists.openembedded.org

From: Vijay Anusuri <[email protected]>

Pick patch as per [1]

[1] https://sqlite.org/src/info/3d459f1fb1bd1b5e
[2] https://sqlite.org/forum/forumpost/761eac3c82
[3]

https://gist.github.com/cnwangjihe/f496393f30f5ecec5b18c8f5ab072054

Quoted 6 lines
Quoted 6 lines
Quoted 3 lines

---

Hello,

Quoted 7 lines
Quoted 7 lines

As far as I can tell, this CVE applies to master. Since this is the end of kirkstone soon, I'll take it into the reviews series but can only merge it if there is a patch sent for this CVE in those branches.

Regards,

Quoted 1 line
 .../sqlite/files/CVE-2025-70873.patch         | 33

+++++++++++++++++++

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
 meta/recipes-support/sqlite/sqlite3_3.38.5.bb |  1 +
 2 files changed, 34 insertions(+)
 create mode 100644

meta/recipes-support/sqlite/files/CVE-2025-70873.patch

Quoted 1 line
Quoted 8 lines
Quoted 8 lines

Review

Quoted 1 line
(quoted diff) +0 -0

b/meta/recipes-support/sqlite/files/CVE-2025-70873.patch

meta/recipes-support/sqlite/files/CVE-2025-70873.patch line 1

Quoted 6 lines

new file mode 100644
index 0000000000..86004c0b74

meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +1 -0
@@ -0,0 +1,33 @@
+From 5a05c59d4d75c03f23d5fb70feac9f789954bf8a Mon Sep 17 00:00:00

2001

Quoted 3 lines
Quoted 3 lines

meta/recipes-support/sqlite/files/CVE-2025-70873.patch

Quoted 3 lines
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +3 -0
+From: drh <>
+Date: Sat, 6 Dec 2025 20:41:24 +0000
+Subject: [PATCH] In the zipfile extension, only return as many bytes

as

Quoted 10 lines
Quoted 10 lines

meta/recipes-support/sqlite/files/CVE-2025-70873.patch line 6

Quoted 2 lines
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +2 -0
+ Inflate actually generated.  [forum:/forumpost/761eac3c82|Forum post
+ 761eac3c82]. Adjust ./configure so that it builds zipfile into

testfixture if

meta/recipes-support/sqlite/files/CVE-2025-70873.patch

Quoted 3 lines
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +3 -0
+ ZLIB is available, so that tests get run on unix platforms.
+
+FossilOrigin-Name:

3d459f1fb1bd1b5e723629c463ab392af7b206ece3388bda216c6a4c26160909

meta/recipes-support/sqlite/files/CVE-2025-70873.patch line 11

Quoted 2 lines
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +2 -0
+
+Upstream-Status: Backport [

https://github.com/sqlite/sqlite/commit/5a05c59d4d75c03f23d5fb70feac9f789954bf8a

Quoted 41 lines
Quoted 41 lines

]

Quoted 6 lines
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +6 -0
+CVE: CVE-2025-70873
+Signed-off-by: Vijay Anusuri <[email protected]>
+---
+ shell.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+

meta/recipes-support/sqlite/files/CVE-2025-70873.patch

Quoted 10 lines
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +10 -0
+diff --git a/shell.c b/shell.c
+index fa45d40..3c4902c 100644
+--- a/shell.c
++++ b/shell.c
+@@ -7668,7 +7668,7 @@ static void zipfileInflate(
+       if( err!=Z_STREAM_END ){
+         zipfileCtxErrorMsg(pCtx, "inflate() failed (%d)", err);
+       }else{
+-        sqlite3_result_blob(pCtx, aRes, nOut, zipfileFree);
++        sqlite3_result_blob(pCtx, aRes, (int)str.total_out,

zipfileFree);

Review

Quoted 7 lines
meta/recipes-support/sqlite/files/CVE-2025-70873.patch new file +6 -0
+         aRes = 0;
+       }
+     }
+--
+2.25.1
+
(quoted diff) +0 -0

b/meta/recipes-support/sqlite/sqlite3_3.38.5.bb

meta/recipes-support/sqlite/sqlite3_3.38.5.bb SRC_URI = "

Quoted 4 lines

index acdd80022e..9e10caa399 100644

meta/recipes-support/sqlite/sqlite3_3.38.5.bb +0 -0
@@ -10,6 +10,7 @@ SRC_URI = "

http://www.sqlite.org/2022/sqlite-autoconf-${SQLITE_PV}.tar.gz \

meta/recipes-support/sqlite/sqlite3_3.38.5.bb SRC_URI = "http://www.sqlite.org/2022/sqlite-autoconf-${SQLITE_PV}.tar.gz \

Quoted 6 lines
meta/recipes-support/sqlite/sqlite3_3.38.5.bb +1 -0
            file://CVE-2023-7104.patch \
            file://CVE-2025-29088.patch \
            file://CVE-2025-6965.patch \
+           file://CVE-2025-70873.patch \
            "
 SRC_URI[sha256sum] =

"5af07de982ba658fd91a03170c945f99c971f6955bc79df3266544373e39869c"

Quoted 1 line
Quoted 5 lines
Quoted 5 lines

--
Yoann Congal
Smile ECS

--
Yoann Congal
Smile ECS

Signature · 2 lines
Yoann Congal
Smile ECS