exiv2: patch CVE-2021-37620
PATCH v2 1/1 exiv2: patch CVE-2021-37620
Details: https://nvd.nist.gov/vuln/detail/CVE-2021-37620
Pick the patches from the PR that is referenced by the NVD advisory.
Two notes:
1. The regression test contains a binary patch, that couldn't be applied in the do_patch task. Due to this the test was not backported. It was however applied manually and executed successfully during the preparation of this patch.
2. The commit changes some "unsigned" types to "size_t", which is not included in this backport. They were already done by another patch (the one for CVE-2021-34334).
Signed-off-by Gyorgy Sarvari <[email protected]>
---
v2: the change in xmp.ccp was backported incorrectly. This should be fixed
in this version.
.../exiv2/exiv2/CVE-2021-37620-1.patch | 26 ++ .../exiv2/exiv2/CVE-2021-37620-2.patch | 306 ++++++++++++++++++ meta-oe/recipes-support/exiv2/exiv2_0.27.3.bb | 2 + 3 files changed, 334 insertions(+) create mode 100644 meta-oe/recipes-support/exiv2/exiv2/CVE-2021-37620-1.patch create mode 100644 meta-oe/recipes-support/exiv2/exiv2/CVE-2021-37620-2.patch
meta-oe/recipes-support/exiv2/exiv2/CVE-2021-37620-1.patch new file +26 -0
@@ -0,0 +1,26 @@ +From 672bb4c98a98911f91834617e8a7374acb903206 Mon Sep 17 00:00:00 2001 +From: Kevin Backhouse <[email protected]> +Date: Sat, 10 Jul 2021 10:42:24 +0100 +Subject: [PATCH] Check that `type` isn't an empty string. + +CVE: CVE-2021-37620 +Upstream-Status: Backport [https://github.com/Exiv2/exiv2/commit/2e7bb581a234bfb0d0c9e16a1dbf037a8c30681e] +Signed-off-by: Gyorgy Sarvari <[email protected]> +--- + src/value.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/value.cpp b/src/value.cpp +index 95eb05a..2536b84 100644 +--- a/src/value.cpp ++++ b/src/value.cpp +@@ -714,6 +714,9 @@ namespace Exiv2 { + if (buf.length() > 5 && buf.substr(0, 5) == "type=") { + std::string::size_type pos = buf.find_first_of(' '); + type = buf.substr(5, pos-5); ++ if (type.empty()) { ++ throw Error(kerInvalidXmpText, type); ++ } + // Strip quotes (so you can also specify the type without quotes) + if (type[0] == '"') type = type.substr(1); + if (type[type.length()-1] == '"') type = type.substr(0, type.length()-1);
meta-oe/recipes-support/exiv2/exiv2/CVE-2021-37620-2.patch new file +306 -0
306 lines not on this page · raw message
meta-oe/recipes-support/exiv2/exiv2_0.27.3.bb +2 -0
@@ -26,6 +26,8 @@ SRC_URI = "https://github.com/Exiv2/${BPN}/releases/download/v${PV}/${BP}-Source file://CVE-2021-37615-2.patch \ file://CVE-2021-37618.patch \ file://CVE-2021-37619.patch \ + file://CVE-2021-37620-1.patch \ + file://CVE-2021-37620-2.patch \ " SRC_URI[sha256sum] = "a79f5613812aa21755d578a297874fb59a85101e793edc64ec2c6bd994e3e778"