public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/eog] f43: Fix CVE-2026-107651
@ 2026-10-23 21:31 Adrian Vovk
  0 siblings, 0 replies; only message in thread
From: Adrian Vovk @ 2026-10-23 21:31 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/eog
            Branch : f43
            Commit : 341911e35f0eb1454e496068afe7ac8716eb1cda
            Author : Adrian Vovk <avovk@redhat.com>
            Date   : 2026-10-23T17:12:43-04:00
            Stats  : +109/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/eog/c/341911e35f0eb1454e496068afe7ac8716eb1cda?branch=f43

            Log:
            Fix CVE-2026-107651

rhbz#2547999

---
diff --git a/CVE-2026-107651.patch b/CVE-2026-107651.patch
new file mode 100644
index 0000000..015ebd8
--- /dev/null
+++ b/CVE-2026-107651.patch
@@ -0,0 +1,108 @@
+From 769e4309ae6976248d8c5debe0ff85ff167ed705 Mon Sep 17 00:00:00 2001
+From: Ege BALCI <pm@ege.sh>
+Date: Sun, 18 Oct 2026 20:07:46 +0200
+Subject: [PATCH] EogMetadataReaderPng: Resume parser in correct state while
+ parsing chunks
+
+If a cHRM or gAMA chunk could not be read at once the parser would
+falsely resume with the state for parsing iCCP chunks. If a shorter iCCP
+chunk was read before, this will trigger a heap buffer overflow.
+
+Fix this by making sure the two affected states resume correctly.
+
+This is CVE-2026-107651. See #342.
+---
+ src/eog-metadata-reader-png.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/eog-metadata-reader-png.c b/src/eog-metadata-reader-png.c
+index 77087686..f22a5f2c 100644
+--- a/src/eog-metadata-reader-png.c
++++ b/src/eog-metadata-reader-png.c
+@@ -420,7 +420,7 @@ eog_metadata_reader_png_consume (EogMetadataReaderPng *emr, const guchar *buf, g
+ 			eog_metadata_reader_png_get_next_block (priv,
+ 							    priv->cHRM_chunk,
+ 							    &i, buf, len,
+-							    EMR_READ_ICCP);
++							    EMR_READ_CHRM);
+ 			break;
+ 		case EMR_READ_GAMA:
+ 			/* Extract the gAMA chunk containing the
+@@ -440,7 +440,7 @@ eog_metadata_reader_png_consume (EogMetadataReaderPng *emr, const guchar *buf, g
+ 			eog_metadata_reader_png_get_next_block (priv,
+ 							    priv->gAMA_chunk,
+ 							    &i, buf, len,
+-							    EMR_READ_ICCP);
++							    EMR_READ_GAMA);
+ 			break;
+ 		default:
+ 			g_assert_not_reached ();
+-- 
+GitLab
+
+
+
+From 04e4f313421eacb9fc529781542bb7fb81a3cd1a Mon Sep 17 00:00:00 2001
+From: Felix Riemann <friemann@gnome.org>
+Date: Sun, 18 Oct 2026 21:00:44 +0200
+Subject: [PATCH] EogMetadataReaderPng: Avoid buffer overflow with malformed
+ iCCP chunks
+
+If a PNGs iCCP chunk does not have a properly terminated profile name
+the parser could overread the chunk while searching for the compressed
+profile data.
+
+This also includes an improvement suggested by Ege BALCI to make sure
+that an iCCP chunk should not be too small to further harden the parser
+against malicious PNGs.
+
+See #342 for context.
+---
+ src/eog-metadata-reader-png.c | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/src/eog-metadata-reader-png.c b/src/eog-metadata-reader-png.c
+index f22a5f2c..43fded9a 100644
+--- a/src/eog-metadata-reader-png.c
++++ b/src/eog-metadata-reader-png.c
+@@ -263,7 +263,7 @@ eog_metadata_reader_png_consume (EogMetadataReaderPng *emr, const guchar *buf, g
+ 			    priv->size > (22 + 54) && priv->xmp_chunk == NULL) {
+ 				priv->state = EMR_READ_XMP_ITXT;
+ 			} else if (memcmp (priv->chunk_name, "iCCP", 4) == 0 &&
+-				   priv->icc_chunk == NULL) {
++				   priv->icc_chunk == NULL && priv->size >= 128) {
+ 				priv->state = EMR_READ_ICCP;
+ 			} else if (memcmp (priv->chunk_name, "sRGB", 4) == 0 &&
+ 				   priv->sRGB_chunk == NULL && priv->size == 1) {
+@@ -520,7 +520,8 @@ eog_metadata_reader_png_get_icc_profile (EogMetadataReaderPng *emr)
+ 
+ 	priv = emr->priv;
+ 
+-	if (priv->icc_chunk) {
++	/* An iCCP chunk needs to be at least 4 bytes long */
++	if (priv->icc_chunk && priv->icc_len >= 4) {
+ 		gpointer outbuf;
+ 		gsize offset = 0;
+ 		z_stream zstr;
+@@ -532,11 +533,15 @@ eog_metadata_reader_png_get_icc_profile (EogMetadataReaderPng *emr)
+ 		zstr.opaque = Z_NULL;
+ 
+ 		/* Skip the name of the ICC profile */
+-		while (*((guchar*)priv->icc_chunk+offset) != '\0')
++		while (offset < priv->icc_len
++		       && *((guchar*)priv->icc_chunk+offset) != '\0')
+ 			offset++;
+ 		/* Ensure the compression method (deflate) */
+-		if (*((guchar*)priv->icc_chunk+(++offset)) != '\0')
++		if (offset >= (priv->icc_len - 2)
++		    || *((guchar*)priv->icc_chunk+(++offset)) != '\0') {
++			eog_debug_message (DEBUG_IMAGE_DATA, "Nonconforming ICC chunk. Ignoring.");
+ 			return NULL;
++		 }
+ 		++offset; //offset now points to the start of the deflated data
+ 
+ 		/* Prepare the zlib data structure for decompression */
+-- 
+GitLab
+
+

diff --git a/eog.spec b/eog.spec
index 2603fcc..c79e7fd 100644
--- a/eog.spec
+++ b/eog.spec
@@ -15,6 +15,7 @@ License: GPL-2.0-or-later AND CC-BY-SA-3.0 AND CC0-1.0
 URL:     https://wiki.gnome.org/Apps/EyeOfGnome
 Source0: https://download.gnome.org/sources/%{name}/49/%{name}-%{tarball_version}.tar.xz
 Patch0:  libpeas1_pygobject352.patch
+Patch1:  CVE-2026-107651.patch
 
 BuildRequires: pkgconfig(exempi-2.0)
 BuildRequires: pkgconfig(gdk-pixbuf-2.0)

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-23 21:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-23 21:31 [rpms/eog] f43: Fix CVE-2026-107651 Adrian Vovk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox