cups-filters: patch CVE-2025-64524
PATCH 1/2 cups-filters: patch CVE-2025-64524
From: Ankur Tyagi <[email protected]>
Details https://nvd.nist.gov/vuln/detail/CVE-2025-64524
Signed-off-by Ankur Tyagi <[email protected]>
--- .../cups/cups-filters/CVE-2025-64524.patch | 81 +++++++++++++++++++ .../cups/cups-filters_2.0.0.bb | 1 + 2 files changed, 82 insertions(+) create mode 100644 meta-oe/recipes-printing/cups/cups-filters/CVE-2025-64524.patch
meta-oe/recipes-printing/cups/cups-filters/CVE-2025-64524.patch new file +81 -0
@@ -0,0 +1,81 @@ +From a6cc1c750006a8ac4e5d692f3a7d9ade479519ec Mon Sep 17 00:00:00 2001 +From: Zdenek Dohnal <[email protected]> +Date: Wed, 12 Nov 2025 15:47:24 +0100 +Subject: [PATCH] rastertopclx.c: Fix infinite loop caused by crafted file + +Infinite loop happened because of crafted input raster file, which led +into heap buffer overflow of `CompressBuf` array. + +Based on comments there should be always some `count` when compressing +the data, and processing of crafted file ended with offset and count +being 0. + +Fixes CVE-2025-64524 + +CVE: CVE-2025-64524 +Upstream-Status: Backport [https://github.com/OpenPrinting/cups-filters/commit/0fe46c511e81062575b05936f804eb18c9f0a011] +(cherry picked from commit 0fe46c511e81062575b05936f804eb18c9f0a011) +Signed-off-by: Ankur Tyagi <[email protected]> +--- + filter/rastertopclx.c | 25 +++++++++++++++++++++++-- + 1 file changed, 23 insertions(+), 2 deletions(-) + +diff --git a/filter/rastertopclx.c b/filter/rastertopclx.c +index ded86f114..39cb378bf 100644 +--- a/filter/rastertopclx.c ++++ b/filter/rastertopclx.c +@@ -825,10 +825,10 @@ StartPage(cf_filter_data_t *data, // I - filter data + } + + if (header->cupsCompression) +- CompBuffer = malloc(DotBufferSize * 4); ++ CompBuffer = calloc(DotBufferSize * 4, sizeof(unsigned char)); + + if (header->cupsCompression >= 3) +- SeedBuffer = malloc(DotBufferSize); ++ SeedBuffer = calloc(DotBufferSize, sizeof(unsigned char)); + + SeedInvalid = 1; + +@@ -1159,6 +1159,13 @@ CompressData(unsigned char *line, // I - Data to compress + seed ++; + count ++; + } ++ ++ // ++ // Bail out if we don't have count to compress ++ // ++ ++ if (count == 0) ++ break; + } + + // +@@ -1252,6 +1259,13 @@ CompressData(unsigned char *line, // I - Data to compress + + count = line_ptr - start; + ++ // ++ // Bail out if we don't have count to compress ++ // ++ ++ if (count == 0) ++ break; ++ + #if 0 + fprintf(stderr, + "DEBUG: offset=%d, count=%d, comp_ptr=%p(%d of %d)...\n", +@@ -1424,6 +1438,13 @@ CompressData(unsigned char *line, // I - Data to compress + + count = (line_ptr - start) / 3; + ++ // ++ // Bail out if we don't have count to compress ++ // ++ ++ if (count == 0) ++ break; ++ + // + // Place mode 10 compression data in the buffer; each sequence + // starts with a command byte that looks like:
meta-oe/recipes-printing/cups/cups-filters_2.0.0.bb +1 -0
@@ -8,6 +8,7 @@ DEPENDS = "libcupsfilters libppd glib-2.0 poppler" SRC_URI = " \ https://github.com/OpenPrinting/${BPN}/releases/download/${PV}/${BP}.tar.xz \ file://fix-make-race.patch \ + file://CVE-2025-64524.patch \ " SRC_URI[sha256sum] = "b5152e3dd148ed73835827ac2f219df7cf5808dbf9dbaec2aa0127b44de800d8"
PATCH 2/2 freerdp3: patch CVE-2025-68118
From: Ankur Tyagi <[email protected]>
Details https://nvd.nist.gov/vuln/detail/CVE-2025-68118
Signed-off-by Ankur Tyagi <[email protected]>
--- .../freerdp/freerdp3/CVE-2025-68118.patch | 57 +++++++++++++++++++ .../recipes-support/freerdp/freerdp3_3.4.0.bb | 1 + 2 files changed, 58 insertions(+) create mode 100644 meta-oe/recipes-support/freerdp/freerdp3/CVE-2025-68118.patch
meta-oe/recipes-support/freerdp/freerdp3/CVE-2025-68118.patch new file +57 -0
@@ -0,0 +1,57 @@ +From 054ff633bb1eac3d165a501d5eb691af1faf0538 Mon Sep 17 00:00:00 2001 +From: akallabeth <[email protected]> +Date: Sat, 13 Dec 2025 17:28:43 +0100 +Subject: [PATCH] [crypto,certificate_data] add some hostname sanitation + +CVE: CVE-2025-68118 +Upstream-Status: Backport [https://github.com/FreeRDP/FreeRDP/commit/83d96a81f320cb8a047fd4ef059a6fe4016dbeec] +(cherry picked from commit 83d96a81f320cb8a047fd4ef059a6fe4016dbeec) +Signed-off-by: Ankur Tyagi <[email protected]> +--- + libfreerdp/crypto/certificate_data.c | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +diff --git a/libfreerdp/crypto/certificate_data.c b/libfreerdp/crypto/certificate_data.c +index a48beb448..6408d5d3c 100644 +--- a/libfreerdp/crypto/certificate_data.c ++++ b/libfreerdp/crypto/certificate_data.c +@@ -33,6 +33,8 @@ + #include <freerdp/crypto/certificate_data.h> + + #include "certificate.h" ++#include <freerdp/log.h> ++#define TAG FREERDP_TAG("crypto.certificate_data") + + #include <freerdp/log.h> + #define TAG FREERDP_TAG("crypto") +@@ -64,8 +66,9 @@ static BOOL freerdp_certificate_data_load_cache(rdpCertificateData* data) + WINPR_ASSERT(data); + + freerdp_certificate_data_hash_(data->hostname, data->port, data->cached_hash, +- sizeof(data->cached_hash)); +- if (strnlen(data->cached_hash, sizeof(data->cached_hash)) == 0) ++ sizeof(data->cached_hash) - 1); ++ const size_t len = strnlen(data->cached_hash, sizeof(data->cached_hash)); ++ if ((len == 0) || (len >= sizeof(data->cached_hash))) + goto fail; + + data->cached_subject = freerdp_certificate_get_subject(data->cert); +@@ -97,6 +100,11 @@ static rdpCertificateData* freerdp_certificate_data_new_nocopy(const char* hostn + + if (!hostname || !xcert) + goto fail; ++ if (strnlen(hostname, MAX_PATH) >= MAX_PATH) ++ { ++ WLog_ERR(TAG, "hostname exceeds length limits"); ++ goto fail; ++ } + + certdata = (rdpCertificateData*)calloc(1, sizeof(rdpCertificateData)); + +@@ -251,5 +259,5 @@ char* freerdp_certificate_data_hash(const char* hostname, UINT16 port) + { + char name[MAX_PATH + 10] = { 0 }; + freerdp_certificate_data_hash_(hostname, port, name, sizeof(name)); +- return _strdup(name); ++ return strndup(name, sizeof(name)); + }
meta-oe/recipes-support/freerdp/freerdp3_3.4.0.bb +1 -0
@@ -20,6 +20,7 @@ SRC_URI = "git://github.com/FreeRDP/FreeRDP.git;branch=master;protocol=https \ file://CVE-2024-32661.patch \ file://CVE-2024-32662.patch \ file://CVE-2025-4478.patch \ + file://CVE-2025-68118.patch \ " S = "${WORKDIR}/git"