From e22d8fc3e122629e5542c9c26a00bb8577df7a95 Mon Sep 17 00:00:00 2001 From: Rohini Sangam Date: Thu, 17 Sep 2026 15:24:57 +0530 Subject: [PATCH] python3-pillow: Security fix for CVE-2026-59204 Pick patch from [1] also mentioned at NVD report in [2] [1] https://github.com/python-pillow/Pillow/commit/13ada41172142f2fd9f0906f615a00ea623a11ca [2] https://nvd.nist.gov/vuln/detail/cve-2026-59204 Signed-off-by: Rohini Sangam Signed-off-by: Anuj Mittal --- .../python3-pillow/CVE-2026-59204.patch | 37 +++++++++++++++++++ .../python/python3-pillow_10.3.0.bb | 1 + 2 files changed, 38 insertions(+) create mode 100644 meta-python/recipes-devtools/python/python3-pillow/CVE-2026-59204.patch diff --git a/meta-python/recipes-devtools/python/python3-pillow/CVE-2026-59204.patch b/meta-python/recipes-devtools/python/python3-pillow/CVE-2026-59204.patch new file mode 100644 index 0000000000..cc55b3c19f --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-pillow/CVE-2026-59204.patch @@ -0,0 +1,37 @@ +From 13ada41172142f2fd9f0906f615a00ea623a11ca Mon Sep 17 00:00:00 2001 +From: Andrew Murray <3112309+radarhere@users.noreply.github.com> +Date: Mon, 22 Jun 2026 10:34:18 +1000 +Subject: [PATCH] Calculate JPEG2000 total_component_width for each tile in + isolation (#9704) + +CVE: CVE-2026-59204 +Upstream-Status: Backport [https://github.com/python-pillow/Pillow/commit/13ada41172142f2fd9f0906f615a00ea623a11ca] + +Signed-off-by: Rohini Sangam +--- + src/libImaging/Jpeg2KDecode.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/libImaging/Jpeg2KDecode.c b/src/libImaging/Jpeg2KDecode.c +index 13f363422..9faacaca8 100644 +--- a/src/libImaging/Jpeg2KDecode.c ++++ b/src/libImaging/Jpeg2KDecode.c +@@ -657,7 +657,6 @@ j2k_decode_entry(Imaging im, ImagingCodecState state) { + size_t buffer_size = 0, tile_bytes = 0; + unsigned n, tile_height, tile_width; + int subsampling; +- int total_component_width = 0; + + stream = opj_stream_create(BUFFER_SIZE, OPJ_TRUE); + +@@ -863,6 +862,7 @@ j2k_decode_entry(Imaging im, ImagingCodecState state) { + a, and then a malicious file could have a smaller tile_bytes + */ + ++ int total_component_width = 0; + for (n=0; n < tile_info.nb_comps; n++) { + // see csize /acsize calcs + int csize = (image->comps[n].prec + 7) >> 3; +-- +2.44.4 + diff --git a/meta-python/recipes-devtools/python/python3-pillow_10.3.0.bb b/meta-python/recipes-devtools/python/python3-pillow_10.3.0.bb index 35ecaaa4c8..cc05570dad 100644 --- a/meta-python/recipes-devtools/python/python3-pillow_10.3.0.bb +++ b/meta-python/recipes-devtools/python/python3-pillow_10.3.0.bb @@ -12,6 +12,7 @@ SRC_URI = "git://github.com/python-pillow/Pillow.git;branch=main;protocol=https file://CVE-2026-40192.patch \ file://CVE-2026-42311.patch \ file://CVE-2026-59198.patch \ + file://CVE-2026-59204.patch \ " SRCREV = "5c89d88eee199ba53f64581ea39b6a1bc52feb1a"