Skip to contentSkip to conversation

exiv2: patch CVE-2026-25884

PATCH New Gyorgy Sarvari 1 participant 2 messages Mar 11

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 exiv2: patch CVE-2026-25884

Details: https://nvd.nist.gov/vuln/detail/CVE-2026-25884

Backport the commits referenced by the NVD advisory.

Note that the regression tests are not included in this test. The patch contains binary data, which cannot be applied with any of the PATCHTOOLs in do_patch task.

---
 .../exiv2/exiv2/CVE-2026-25884.patch          | 25 +++++++++++++++++++
 meta-oe/recipes-support/exiv2/exiv2_0.27.3.bb |  1 +
 2 files changed, 26 insertions(+)
 create mode 100644 meta-oe/recipes-support/exiv2/exiv2/CVE-2026-25884.patch
meta-oe/recipes-support/exiv2/exiv2/CVE-2026-25884.patch new file +25 -0
new file mode 100644
index 0000000000..624c53f49b
@@ -0,0 +1,25 @@
+From cfbe7e48cbfa63b88b3dcf9d99272330f8349c4f Mon Sep 17 00:00:00 2001
+From: Kevin Backhouse <[email protected]>
+Date: Sat, 31 Jan 2026 15:31:55 +0000
+Subject: [PATCH] Fix out-of-bounds read.
+
+CVE: CVE-2026-25884
+Upstream-Status: Backport [https://github.com/Exiv2/exiv2/commit/5b8f1f4d92b8f27a5a80e0c3d3eb9dce7620d9f1]
+Signed-off-by: Gyorgy Sarvari <[email protected]>
+---
+ src/crwimage_int.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/crwimage_int.cpp b/src/crwimage_int.cpp
+index 570de75..8791dbd 100644
+--- a/src/crwimage_int.cpp
++++ b/src/crwimage_int.cpp
+@@ -812,7 +812,7 @@ namespace Exiv2 {
+                                     Image&         image,
+                                     ByteOrder      /*byteOrder*/)
+     {
+-        std::string s(reinterpret_cast<const char*>(ciffComponent.pData()));
++        auto s = std::string(reinterpret_cast<const char*>(ciffComponent.pData()), ciffComponent.size());
+         image.setComment(s);
+     } // CrwMap::decode0x0805
+ 
meta-oe/recipes-support/exiv2/exiv2_0.27.3.bb +1 -0
index 4700173de4..602ef3910f 100644
@@ -32,6 +32,7 @@ SRC_URI = "https://github.com/Exiv2/${BPN}/releases/download/v${PV}/${BP}-Source
            file://CVE-2021-37621-2.patch \
            file://CVE-2021-37622-1.patch \
            file://CVE-2021-37622-2.patch \
+           file://CVE-2026-25884.patch \
            "
 SRC_URI[sha256sum] = "a79f5613812aa21755d578a297874fb59a85101e793edc64ec2c6bd994e3e778"
 
#1 lore raw

PATCH 2/2 exiv2: patch CVE-2026-27596

Details: https://nvd.nist.gov/vuln/detail/CVE-2026-27596

Backport the commits referenced by the NVD advisory.

---
 .../exiv2/exiv2/CVE-2026-27596-1.patch        | 58 +++++++++++++++++++
 .../exiv2/exiv2/CVE-2026-27596-2.patch        | 24 ++++++++
 meta-oe/recipes-support/exiv2/exiv2_0.27.3.bb |  2 +
 3 files changed, 84 insertions(+)
 create mode 100644 meta-oe/recipes-support/exiv2/exiv2/CVE-2026-27596-1.patch
 create mode 100644 meta-oe/recipes-support/exiv2/exiv2/CVE-2026-27596-2.patch
meta-oe/recipes-support/exiv2/exiv2/CVE-2026-27596-1.patch new file +58 -0
new file mode 100644
index 0000000000..67757947d3
@@ -0,0 +1,58 @@
+From 05d3cc42c6f56678ae62697d60af01af8876eada Mon Sep 17 00:00:00 2001
+From: Kevin Backhouse <[email protected]>
+Date: Thu, 26 Feb 2026 20:44:18 +0000
+Subject: [PATCH] Regression test for
+ https://github.com/Exiv2/exiv2/issues/3511
+
+CVE: CVE-2026-27596
+Upstream-Status: Backport [https://github.com/Exiv2/exiv2/commit/fe0d0154ab2886feb503e6cfd38c3b6d5722921f]
+Signed-off-by: Gyorgy Sarvari <[email protected]>
+---
+ test/data/issue_3511_poc.eps             | 13 +++++++++++++
+ tests/bugfixes/github/test_issue_3511.py | 17 +++++++++++++++++
+ 2 files changed, 30 insertions(+)
+ create mode 100644 test/data/issue_3511_poc.eps
+ create mode 100644 tests/bugfixes/github/test_issue_3511.py
+
+diff --git a/test/data/issue_3511_poc.eps b/test/data/issue_3511_poc.eps
+new file mode 100644
+index 0000000..4d403cc
+--- /dev/null
++++ b/test/data/issue_3511_poc.eps
+@@ -0,0 +1,13 @@
++%!PS-Adobe-3.0 EPSF-3.0
++%%BoundingBox: 0 0 100 100
++%%EndComments
++%%BeginProlog
++%%EndProlog
++%%Page: 1 1
++%%BeginPageSetup
++%%EndPageSetup
++%BeginPhotoshop: 16
++3842494D040C00000000000441424344
++%EndPhotoshop
++%%PageTrailer
++%%EOF
+diff --git a/tests/bugfixes/github/test_issue_3511.py b/tests/bugfixes/github/test_issue_3511.py
+new file mode 100644
+index 0000000..1825550
+--- /dev/null
++++ b/tests/bugfixes/github/test_issue_3511.py
+@@ -0,0 +1,17 @@
++# -*- coding: utf-8 -*-
++
++import system_tests
++
++
++class test_issue_3511_sigma_LoaderNative_getData(metaclass=system_tests.CaseMeta):
++    url = "https://github.com/Exiv2/exiv2/issues/3511"
++
++    filename = "$data_path/issue_3511_poc.eps"
++    commands = ["$exiv2 -pp $filename"]
++    retval = [1]
++    stderr = [
++        """$exiv2_exception_message $filename:
++$kerCorruptedMetadata
++"""
++    ]
++    stdout = [""]
meta-oe/recipes-support/exiv2/exiv2/CVE-2026-27596-2.patch new file +24 -0
new file mode 100644
index 0000000000..addc01bfd0
@@ -0,0 +1,24 @@
+From 6b65696b4af2f0a6b6756ba693aebf83889bafa3 Mon Sep 17 00:00:00 2001
+From: Kevin Backhouse <[email protected]>
+Date: Thu, 26 Feb 2026 20:44:54 +0000
+Subject: [PATCH] Check for integer overflow.
+
+CVE: CVE-2026-27596
+Upstream-Status: Backport [https://github.com/Exiv2/exiv2/commit/2cb728a850b4aa048a683711906d716c5f9a32ac]
+Signed-off-by: Gyorgy Sarvari <[email protected]>
+---
+ src/preview.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/preview.cpp b/src/preview.cpp
+index d99a03a..aefb323 100644
+--- a/src/preview.cpp
++++ b/src/preview.cpp
+@@ -492,6 +492,7 @@ namespace {
+ #endif
+                 return DataBuf();
+             }
++            enforce(sizeData >= 28, Exiv2::kerCorruptedMetadata);
+             return DataBuf(record + sizeHdr + 28, sizeData - 28);
+         } else {
+             throw Error(kerErrorMessage, "Invalid native preview filter: " + nativePreview_.filter_);
meta-oe/recipes-support/exiv2/exiv2_0.27.3.bb +2 -0
index 602ef3910f..2bf9c88b3e 100644
@@ -33,6 +33,8 @@ SRC_URI = "https://github.com/Exiv2/${BPN}/releases/download/v${PV}/${BP}-Source
            file://CVE-2021-37622-1.patch \
            file://CVE-2021-37622-2.patch \
            file://CVE-2026-25884.patch \
+           file://CVE-2026-27596-1.patch \
+           file://CVE-2026-27596-2.patch \
            "
 SRC_URI[sha256sum] = "a79f5613812aa21755d578a297874fb59a85101e793edc64ec2c6bd994e3e778"