Skip to content

Commit 4ef32c9

Browse files
azurelinux-securityKanishk-Bansalakhila-guruju
authored
[AutoPR- Security] Patch cups for CVE-2025-58364, CVE-2025-58060 [HIGH] (microsoft#14672)
Co-authored-by: Kanishk Bansal <[email protected]> Co-authored-by: akhila-guruju <[email protected]>
1 parent 7ff6071 commit 4ef32c9

File tree

4 files changed

+151
-12
lines changed

4 files changed

+151
-12
lines changed

SPECS/cups/CVE-2024-35235.patch

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,31 @@
1-
From 192f5bd1b197e577b2332d4fdc8038c6b2993d6e Mon Sep 17 00:00:00 2001
2-
From: kavyasree <kkaitepalli@microsoft.com>
3-
Date: Thu, 21 Nov 2024 13:46:00 +0530
4-
Subject: [PATCH] Fix CVE-2024-35235
1+
From a436956f374b0fd7f5da9df482e4f5840fa1c0d2 Mon Sep 17 00:00:00 2001
2+
From: Zdenek Dohnal <zdohnal@redhat.com>
3+
Date: Mon, 3 Jun 2024 18:53:58 +0200
4+
Subject: [PATCH] Fix domain socket handling
55

6+
- Check status of unlink and bind system calls.
7+
- Don't allow extra domain sockets when running from launchd/systemd.
8+
- Validate length of domain socket path (< sizeof(sun_path))
9+
10+
Fixes CVE-2024-35235, written by Mike Sweet
11+
12+
Upstream Patch Reference: https://github.com/OpenPrinting/cups/commit/a436956f374b0fd7f5da9df482e4f5840fa1c0d2.patch
613
---
714
cups/http-addr.c | 37 +++++++++++++++++++------------------
815
scheduler/conf.c | 20 ++++++++++++++++++++
916
2 files changed, 39 insertions(+), 18 deletions(-)
1017

1118
diff --git a/cups/http-addr.c b/cups/http-addr.c
12-
index 8e81c6f..d65d4cc 100644
19+
index cddb63c..5aba715 100644
1320
--- a/cups/http-addr.c
1421
+++ b/cups/http-addr.c
15-
@@ -199,28 +199,29 @@ httpAddrListen(http_addr_t *addr, /* I - Address to bind to */
22+
@@ -203,28 +203,29 @@ httpAddrListen(http_addr_t *addr, /* I - Address to bind to */
1623
/*
1724
* Remove any existing domain socket file...
1825
*/
1926
+ if ((status = unlink(addr->un.sun_path)) < 0)
2027
+ {
21-
+ DEBUG_printf("1httpAddrListen: Unable to unlink \"%s\": %s", addr->un.sun_path, strerror(errno));
28+
+ DEBUG_printf(("1httpAddrListen: Unable to unlink \"%s\": %s", addr->un.sun_path, strerror(errno)));
2229

2330
- unlink(addr->un.sun_path);
2431
-
@@ -52,7 +59,7 @@ index 8e81c6f..d65d4cc 100644
5259
+ // Bind the domain socket...
5360
+ if ((status = bind(fd, (struct sockaddr *)addr, (socklen_t)httpAddrLength(addr))) < 0)
5461
+ {
55-
+ DEBUG_printf("1httpAddrListen: Unable to bind domain socket \"%s\": %s", addr->un.sun_path, strerror(errno));
62+
+ DEBUG_printf(("1httpAddrListen: Unable to bind domain socket \"%s\": %s", addr->un.sun_path, strerror(errno)));
5663
+ }
5764
+ // Restore the umask...
5865
+ umask(mask);
@@ -61,10 +68,10 @@ index 8e81c6f..d65d4cc 100644
6168
else
6269
#endif /* AF_LOCAL */
6370
diff --git a/scheduler/conf.c b/scheduler/conf.c
64-
index 74531a8..180ef9b 100644
71+
index 8b40d59..0b557d4 100644
6572
--- a/scheduler/conf.c
6673
+++ b/scheduler/conf.c
67-
@@ -3071,6 +3071,26 @@ read_cupsd_conf(cups_file_t *fp) /* I - File to read from */
74+
@@ -3112,6 +3112,26 @@ read_cupsd_conf(cups_file_t *fp) /* I - File to read from */
6875
cupsd_listener_t *lis; /* New listeners array */
6976

7077

@@ -92,5 +99,5 @@ index 74531a8..180ef9b 100644
9299
* Get the address list...
93100
*/
94101
--
95-
2.34.1
102+
2.43.0
96103

SPECS/cups/CVE-2025-58060.patch

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
From 595d691075b1d396d2edfaa0a8fd0873a0a1f221 Mon Sep 17 00:00:00 2001
2+
From: Zdenek Dohnal <[email protected]>
3+
Date: Thu, 11 Sep 2025 14:44:59 +0200
4+
Subject: [PATCH] cupsd: Block authentication using alternate method
5+
6+
Fixes: CVE-2025-58060
7+
8+
Upstream Patch Reference: https://github.com/OpenPrinting/cups/commit/595d691075b1d396d2edfaa0a8fd0873a0a1f221.patch
9+
10+
---
11+
scheduler/auth.c | 20 +++++++++++++++++++-
12+
1 file changed, 19 insertions(+), 1 deletion(-)
13+
14+
diff --git a/scheduler/auth.c b/scheduler/auth.c
15+
index 4fbad6e..a94a5fe 100644
16+
--- a/scheduler/auth.c
17+
+++ b/scheduler/auth.c
18+
@@ -505,6 +505,16 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */
19+
int userlen; /* Username:password length */
20+
21+
22+
+ /*
23+
+ * Only allow Basic if enabled...
24+
+ */
25+
+
26+
+ if (type != CUPSD_AUTH_BASIC)
27+
+ {
28+
+ cupsdLogClient(con, CUPSD_LOG_ERROR, "Basic authentication is not enabled.");
29+
+ return;
30+
+ }
31+
+
32+
authorization += 5;
33+
while (isspace(*authorization & 255))
34+
authorization ++;
35+
@@ -553,7 +563,6 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */
36+
switch (type)
37+
{
38+
default :
39+
- case CUPSD_AUTH_BASIC :
40+
{
41+
#if HAVE_LIBPAM
42+
/*
43+
@@ -725,6 +734,15 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */
44+
/* Output token for username */
45+
gss_name_t client_name; /* Client name */
46+
47+
+ /*
48+
+ * Only allow Kerberos if enabled...
49+
+ */
50+
+
51+
+ if (type != CUPSD_AUTH_NEGOTIATE)
52+
+ {
53+
+ cupsdLogClient(con, CUPSD_LOG_ERROR, "Kerberos authentication is not enabled.");
54+
+ return;
55+
+ }
56+
57+
# ifdef __APPLE__
58+
/*
59+
--
60+
2.43.0
61+

SPECS/cups/CVE-2025-58364.patch

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
From 8e579af3dd4cb082e6a6bce68e2f3263952109c2 Mon Sep 17 00:00:00 2001
2+
From: AllSpark <[email protected]>
3+
Date: Sat, 13 Sep 2025 04:40:46 +0000
4+
Subject: [PATCH] libcups: Fix handling of extension tag in ipp_read_io(); add
5+
error on unable to read attribute name
6+
7+
Signed-off-by: Azure Linux Security Servicing Account <[email protected]>
8+
Upstream-reference: AI Backport of https://github.com/OpenPrinting/cups/commit/e58cba9d6fceed4242980e51dbd1302cf638ab1d.patch
9+
---
10+
cups/ipp.c | 28 +---------------------------
11+
1 file changed, 1 insertion(+), 27 deletions(-)
12+
13+
diff --git a/cups/ipp.c b/cups/ipp.c
14+
index adbb26f..ff53862 100644
15+
--- a/cups/ipp.c
16+
+++ b/cups/ipp.c
17+
@@ -2951,34 +2951,7 @@ ippReadIO(void *src, /* I - Data source */
18+
*/
19+
20+
tag = (ipp_tag_t)buffer[0];
21+
- if (tag == IPP_TAG_EXTENSION)
22+
- {
23+
- /*
24+
- * Read 32-bit "extension" tag...
25+
- */
26+
-
27+
- if ((*cb)(src, buffer, 4) < 4)
28+
- {
29+
- DEBUG_puts("1ippReadIO: Callback returned EOF/error");
30+
- _cupsBufferRelease((char *)buffer);
31+
- return (IPP_STATE_ERROR);
32+
- }
33+
34+
- tag = (ipp_tag_t)((((((buffer[0] << 8) | buffer[1]) << 8) |
35+
- buffer[2]) << 8) | buffer[3]);
36+
-
37+
- if (tag & IPP_TAG_CUPS_CONST)
38+
- {
39+
- /*
40+
- * Fail if the high bit is set in the tag...
41+
- */
42+
-
43+
- _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("IPP extension tag larger than 0x7FFFFFFF."), 1);
44+
- DEBUG_printf(("1ippReadIO: bad tag 0x%x.", tag));
45+
- _cupsBufferRelease((char *)buffer);
46+
- return (IPP_STATE_ERROR);
47+
- }
48+
- }
49+
50+
if (tag == IPP_TAG_END)
51+
{
52+
@@ -3199,6 +3172,7 @@ ippReadIO(void *src, /* I - Data source */
53+
54+
if ((*cb)(src, buffer, (size_t)n) < n)
55+
{
56+
+ _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("Unable to read IPP attribute name."), 1);
57+
DEBUG_puts("1ippReadIO: unable to read name.");
58+
_cupsBufferRelease((char *)buffer);
59+
return (IPP_STATE_ERROR);
60+
--
61+
2.45.4
62+

SPECS/cups/cups.spec

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
Summary: CUPS printing system
1313
Name: cups
1414
Version: 2.3.3%{OP_VER}
15-
Release: 9%{?dist}
15+
Release: 10%{?dist}
1616
License: ASL 2.0 with exceptions
1717
Vendor: Microsoft Corporation
1818
Distribution: Mariner
@@ -65,6 +65,8 @@ Patch15: CVE-2023-32324.patch
6565
Patch16: CVE-2023-34241.patch
6666
Patch17: CVE-2022-26691.patch
6767
Patch18: CVE-2024-35235.patch
68+
Patch19: CVE-2025-58060.patch
69+
Patch20: CVE-2025-58364.patch
6870
#### UPSTREAM PATCHES (starts with 1000) ####
6971
##### Patches removed because IMHO they aren't no longer needed
7072
##### but still I'll leave them in git in case their removal
@@ -267,6 +269,9 @@ to CUPS daemon. This solution will substitute printer drivers and raw queues in
267269
%patch15 -p1
268270
%patch16 -p1
269271
%patch17 -p1
272+
%patch18 -p1
273+
%patch19 -p1
274+
%patch20 -p1
270275

271276
# LSPP support.
272277
%patch100 -p1 -b .lspp
@@ -658,6 +663,10 @@ rm -f %{cups_serverbin}/backend/smb
658663
%{_mandir}/man7/ippeveps.7.gz
659664

660665
%changelog
666+
* Sat Sep 13 2025 Azure Linux Security Servicing Account <[email protected]> - 2.3.3op2-10
667+
- Patch for CVE-2025-58364, CVE-2025-58060
668+
- Fix patch of CVE-2024-35235
669+
661670
* Thu Nov 21 2024 Kavya Sree Kaitepalli <[email protected]> - 2.3.3op2-9
662671
- Add patch for CVE-2024-35235
663672

0 commit comments

Comments
 (0)