mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-01-12 03:24:08 +00:00
exiv2: patch CVE-2025-54080
Details: https://nvd.nist.gov/vuln/detail/CVE-2025-54080 Backport the patch mentioned in the details. Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
From 6a0c63f1362dac8badfad5d2dcc55fb4ff04fc60 Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Backhouse <kevinbackhouse@github.com>
|
||||
Date: Tue, 29 Jul 2025 18:58:46 +0100
|
||||
Subject: [PATCH] CVE-2025-54080 fix
|
||||
|
||||
Upstream-Status: Backport [https://github.com/Exiv2/exiv2/commit/e737332427711f15bcdc4e903203d6b7493eaec0]
|
||||
CVE: CVE-2025-54080
|
||||
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
|
||||
---
|
||||
src/epsimage.cpp | 40 +++++++++++-----------------------------
|
||||
1 file changed, 11 insertions(+), 29 deletions(-)
|
||||
|
||||
diff --git a/src/epsimage.cpp b/src/epsimage.cpp
|
||||
index 2e2241b69..bb4aa3303 100644
|
||||
--- a/src/epsimage.cpp
|
||||
+++ b/src/epsimage.cpp
|
||||
@@ -241,6 +241,8 @@ void readWriteEpsMetadata(BasicIo& io, std::string& xmpPacket, NativePreviewList
|
||||
uint32_t posTiff = 0;
|
||||
uint32_t sizeTiff = 0;
|
||||
|
||||
+ ErrorCode errcode = write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData;
|
||||
+
|
||||
// check for DOS EPS
|
||||
const bool dosEps =
|
||||
(size >= dosEpsSignature.size() && memcmp(data, dosEpsSignature.data(), dosEpsSignature.size()) == 0);
|
||||
@@ -248,12 +250,8 @@ void readWriteEpsMetadata(BasicIo& io, std::string& xmpPacket, NativePreviewList
|
||||
#ifdef DEBUG
|
||||
EXV_DEBUG << "readWriteEpsMetadata: Found DOS EPS signature\n";
|
||||
#endif
|
||||
- if (size < 30) {
|
||||
-#ifndef SUPPRESS_WARNINGS
|
||||
- EXV_WARNING << "Premature end of file after DOS EPS signature.\n";
|
||||
-#endif
|
||||
- throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
|
||||
- }
|
||||
+
|
||||
+ enforce(size >= 30, errcode);
|
||||
posEps = getULong(data + 4, littleEndian);
|
||||
posEndEps = getULong(data + 8, littleEndian) + posEps;
|
||||
posWmf = getULong(data + 12, littleEndian);
|
||||
@@ -285,29 +283,13 @@ void readWriteEpsMetadata(BasicIo& io, std::string& xmpPacket, NativePreviewList
|
||||
if (write)
|
||||
throw Error(ErrorCode::kerImageWriteFailed);
|
||||
}
|
||||
- if (posEps < 30 || posEndEps > size) {
|
||||
-#ifndef SUPPRESS_WARNINGS
|
||||
- EXV_WARNING << "DOS EPS file has invalid position (" << posEps << ") or size (" << (posEndEps - posEps)
|
||||
- << ") for EPS section.\n";
|
||||
-#endif
|
||||
- throw Error(write ? ErrorCode::kerImageWriteFailed : ErrorCode::kerFailedToReadImageData);
|
||||
- }
|
||||
- if (sizeWmf != 0 && (posWmf < 30 || posWmf + sizeWmf > size)) {
|
||||
-#ifndef SUPPRESS_WARNINGS
|
||||
- EXV_WARNING << "DOS EPS file has invalid position (" << posWmf << ") or size (" << sizeWmf
|
||||
- << ") for WMF section.\n";
|
||||
-#endif
|
||||
- if (write)
|
||||
- throw Error(ErrorCode::kerImageWriteFailed);
|
||||
- }
|
||||
- if (sizeTiff != 0 && (posTiff < 30 || posTiff + sizeTiff > size)) {
|
||||
-#ifndef SUPPRESS_WARNINGS
|
||||
- EXV_WARNING << "DOS EPS file has invalid position (" << posTiff << ") or size (" << sizeTiff
|
||||
- << ") for TIFF section.\n";
|
||||
-#endif
|
||||
- if (write)
|
||||
- throw Error(ErrorCode::kerImageWriteFailed);
|
||||
- }
|
||||
+ enforce(30 <= posEps, errcode);
|
||||
+ enforce(sizeWmf == 0 || 30 <= posWmf, errcode);
|
||||
+ enforce(sizeTiff == 0 || 30 <= posTiff, errcode);
|
||||
+
|
||||
+ enforce(posEps <= posEndEps && posEndEps <= size, errcode);
|
||||
+ enforce(posWmf <= size && sizeWmf <= size - posWmf, errcode);
|
||||
+ enforce(posTiff <= size && sizeTiff <= size - posTiff, errcode);
|
||||
}
|
||||
|
||||
// check first line
|
||||
@@ -6,6 +6,7 @@ DEPENDS = "zlib expat brotli libinih"
|
||||
|
||||
SRC_URI = "git://github.com/Exiv2/exiv2.git;protocol=https;branch=0.28.x \
|
||||
file://0001-Revert-fix-copy-constructors.patch \
|
||||
file://0001-CVE-2025-54080-fix.patch \
|
||||
"
|
||||
SRCREV = "a6a79ef064f131ffd03c110acce2d3edb84ffa2e"
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
Reference in New Issue
Block a user