summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-gnome/recipes-gimp/gimp/gimp/CVE-2025-14423.patch106
-rw-r--r--meta-gnome/recipes-gimp/gimp/gimp_3.0.6.bb1
2 files changed, 107 insertions, 0 deletions
diff --git a/meta-gnome/recipes-gimp/gimp/gimp/CVE-2025-14423.patch b/meta-gnome/recipes-gimp/gimp/gimp/CVE-2025-14423.patch
new file mode 100644
index 0000000000..50a0adfe89
--- /dev/null
+++ b/meta-gnome/recipes-gimp/gimp/gimp/CVE-2025-14423.patch
@@ -0,0 +1,106 @@
1From a83e8c4ad8ffbce40aa9f9a0f49880e802ef7da1 Mon Sep 17 00:00:00 2001
2From: Gyorgy Sarvari <skandigraun@gmail.com>
3Date: Sun, 23 Nov 2025 04:22:49 +0000
4Subject: [PATCH] plug-ins: Fix ZDI-CAN-28311
5
6From: Alx Sa <cmyk.student@gmail.com>
7
8Resolves #15292
9The IFF specification states that EHB format images
10have exactly 32 colors in their palette. However, it
11is possible for images in the wild to place an incorrect
12palette size. This patch checks for this, and either limits
13the palette size or breaks accordingly.
14
15CVE: CVE-2025-14423
16Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/gimp/-/commit/481cdbbb97746be1145ec3a633c567a68633c521]
17Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
18---
19 plug-ins/common/file-iff.c | 32 ++++++++++++++++++++++----------
20 1 file changed, 22 insertions(+), 10 deletions(-)
21
22diff --git a/plug-ins/common/file-iff.c b/plug-ins/common/file-iff.c
23index d144a96..f087947 100644
24--- a/plug-ins/common/file-iff.c
25+++ b/plug-ins/common/file-iff.c
26@@ -337,7 +337,7 @@ load_image (GFile *file,
27 width = bitMapHeader->w;
28 height = bitMapHeader->h;
29 nPlanes = bitMapHeader->nPlanes;
30- row_length = (width + 15) / 16;
31+ row_length = ((width + 15) / 16) * 2;
32 pixel_size = nPlanes / 8;
33 aspect_x = bitMapHeader->xAspect;
34 aspect_y = bitMapHeader->yAspect;
35@@ -375,6 +375,18 @@ load_image (GFile *file,
36 {
37 /* EHB mode adds 32 more colors. Each are half the RGB values
38 * of the first 32 colors */
39+ if (palette_size < 32)
40+ {
41+ g_set_error (error, G_FILE_ERROR,
42+ g_file_error_from_errno (errno),
43+ _("Invalid ILBM colormap size"));
44+ return NULL;
45+ }
46+ else if (palette_size > 32)
47+ {
48+ palette_size = 32;
49+ }
50+
51 for (gint j = 0; j < palette_size * 2; j++)
52 {
53 gint offset_index = j + 32;
54@@ -386,7 +398,7 @@ load_image (GFile *file,
55 gimp_cmap[offset_index * 3 + 2] =
56 colorMap->colorRegister[j].blue / 2;
57 }
58- /* EHB mode always has 64 colors */
59+ /* EHB mode always has 64 colors in total */
60 palette_size = 64;
61 }
62 }
63@@ -447,7 +459,7 @@ load_image (GFile *file,
64 {
65 guchar *pixel_row;
66
67- pixel_row = g_malloc (width * pixel_size * sizeof (guchar));
68+ pixel_row = g_malloc0 (width * pixel_size);
69
70 /* PBM uses one byte per pixel index */
71 if (ILBM_imageIsPBM (true_image))
72@@ -459,7 +471,7 @@ load_image (GFile *file,
73 else
74 deleave_rgb_row (bitplanes, pixel_row, width, nPlanes, pixel_size);
75
76- bitplanes += (row_length * 2 * nPlanes);
77+ bitplanes += (row_length * nPlanes);
78
79 gegl_buffer_set (buffer, GEGL_RECTANGLE (0, y_height, width, 1), 0,
80 NULL, pixel_row, GEGL_AUTO_ROWSTRIDE);
81@@ -528,7 +540,7 @@ deleave_ham_row (const guchar *gimp_cmap,
82 /* Deleave rows */
83 for (gint i = 0; i < row_length; i++)
84 {
85- for (gint j = 0; j < 8; j++)
86+ for (gint j = 0; j < nPlanes; j++)
87 {
88 guint8 bitmask = (1 << (8 - j)) - (1 << (7 - j));
89 guint8 control = 0;
90@@ -590,11 +602,11 @@ deleave_ham_row (const guchar *gimp_cmap,
91 }
92
93 static void
94-deleave_rgb_row (IFF_UByte *bitplanes,
95- guchar *pixel_row,
96- gint width,
97- gint nPlanes,
98- gint pixel_size)
99+deleave_rgb_row (IFF_UByte *bitplanes,
100+ guchar *pixel_row,
101+ gint width,
102+ gint nPlanes,
103+ gint pixel_size)
104 {
105 gint row_length = ((width + 15) / 16) * 2;
106 gint current_pixel = 0;
diff --git a/meta-gnome/recipes-gimp/gimp/gimp_3.0.6.bb b/meta-gnome/recipes-gimp/gimp/gimp_3.0.6.bb
index f529930dff..24281e5dfd 100644
--- a/meta-gnome/recipes-gimp/gimp/gimp_3.0.6.bb
+++ b/meta-gnome/recipes-gimp/gimp/gimp_3.0.6.bb
@@ -62,6 +62,7 @@ SRC_URI = "https://download.gimp.org/gimp/v3.0/${BP}.tar.xz \
62 file://0001-meson.build-dont-check-for-lgi.patch \ 62 file://0001-meson.build-dont-check-for-lgi.patch \
63 file://0001-meson.build-require-iso-codes-native.patch \ 63 file://0001-meson.build-require-iso-codes-native.patch \
64 file://CVE-2025-14422.patch \ 64 file://CVE-2025-14422.patch \
65 file://CVE-2025-14423.patch \
65 " 66 "
66SRC_URI[sha256sum] = "246c225383c72ef9f0dc7703b7d707084bbf177bd2900e94ce466a62862e296b" 67SRC_URI[sha256sum] = "246c225383c72ef9f0dc7703b7d707084bbf177bd2900e94ce466a62862e296b"
67 68