From 93826fffc5afb1f62f680a78ab890d43d32889f2 Mon Sep 17 00:00:00 2001 From: virendra thakur Date: Wed, 8 Oct 2025 18:10:37 +0530 Subject: [PATCH] imagemagick: Fix CVE-2022-28463 Imagemagick is vulnerable to buffer overflow. Reference: https://github.com/ImageMagick/ImageMagick/commit/ca3654ebf7a439dc736f56f083c9aa98e4464b7f Signed-off-by: virendra thakur Signed-off-by: Gyorgy Sarvari --- .../imagemagick/files/CVE-2022-28463.patch | 26 +++++++++++++++++++ .../imagemagick/imagemagick_7.0.10.bb | 1 + 2 files changed, 27 insertions(+) create mode 100644 meta-oe/recipes-support/imagemagick/files/CVE-2022-28463.patch diff --git a/meta-oe/recipes-support/imagemagick/files/CVE-2022-28463.patch b/meta-oe/recipes-support/imagemagick/files/CVE-2022-28463.patch new file mode 100644 index 0000000000..36b0756adf --- /dev/null +++ b/meta-oe/recipes-support/imagemagick/files/CVE-2022-28463.patch @@ -0,0 +1,26 @@ +From ca3654ebf7a439dc736f56f083c9aa98e4464b7f Mon Sep 17 00:00:00 2001 +From: Cristy +Date: Sat, 26 Mar 2022 09:26:57 -0400 +Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/4988 +CVE: CVE-2022-28463 +Upstream-Status: Backport [https://github.com/ImageMagick/ImageMagick/commit/ca3654ebf7a439dc736f56f083c9aa98e4464b7f] +Signed-off-by: Virendra Thakur + +--- + coders/cin.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/coders/cin.c b/coders/cin.c +index e266e7f3c56..23fc17e0890 100644 +--- a/coders/cin.c ++++ b/coders/cin.c +@@ -451,6 +451,8 @@ static Image *ReadCINImage(const ImageInfo *image_info,ExceptionInfo *exception) + image->endian=(magick[0] == 0x80) && (magick[1] == 0x2a) && + (magick[2] == 0x5f) && (magick[3] == 0xd7) ? MSBEndian : LSBEndian; + cin.file.image_offset=ReadBlobLong(image); ++ if (cin.file.image_offset < 712) ++ ThrowReaderException(CorruptImageError,"ImproperImageHeader"); + offset+=4; + cin.file.generic_length=ReadBlobLong(image); + offset+=4; + diff --git a/meta-oe/recipes-support/imagemagick/imagemagick_7.0.10.bb b/meta-oe/recipes-support/imagemagick/imagemagick_7.0.10.bb index ce5489bb3e..fcbbd6fca2 100644 --- a/meta-oe/recipes-support/imagemagick/imagemagick_7.0.10.bb +++ b/meta-oe/recipes-support/imagemagick/imagemagick_7.0.10.bb @@ -23,6 +23,7 @@ SRC_URI = "git://github.com/ImageMagick/ImageMagick.git;branch=main;protocol=htt file://CVE-2023-1289.patch \ file://CVE-2023-34474.patch \ file://CVE-2023-5341.patch \ + file://CVE-2022-28463.patch \ " SRCREV = "35b4991eb0939a327f3489988c366e21068b0178"