]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
cupsd: Block authentication using alternate method
authorZdenek Dohnal <zdohnal@redhat.com>
Thu, 11 Sep 2025 12:44:59 +0000 (14:44 +0200)
committerZdenek Dohnal <zdohnal@redhat.com>
Thu, 11 Sep 2025 12:44:59 +0000 (14:44 +0200)
Fixes: CVE-2025-58060
scheduler/auth.c

index 5fa53644de4e77dad1d8021ebfdedf42befec702..3c9aa72aaf24ac026faaadbd7733403e0b9818e0 100644 (file)
@@ -513,6 +513,16 @@ cupsdAuthorize(cupsd_client_t *con)        /* I - Client connection */
     int        userlen;                        /* Username:password length */
 
 
+   /*
+    * Only allow Basic if enabled...
+    */
+
+    if (type != CUPSD_AUTH_BASIC)
+    {
+      cupsdLogClient(con, CUPSD_LOG_ERROR, "Basic authentication is not enabled.");
+      return;
+    }
+
     authorization += 5;
     while (isspace(*authorization & 255))
       authorization ++;
@@ -558,7 +568,6 @@ cupsdAuthorize(cupsd_client_t *con) /* I - Client connection */
     * Validate the username and password...
     */
 
-    if (type == CUPSD_AUTH_BASIC)
     {
 #if HAVE_LIBPAM
      /*
@@ -727,6 +736,16 @@ cupsdAuthorize(cupsd_client_t *con)        /* I - Client connection */
                                        /* Output token for username */
     gss_name_t         client_name;    /* Client name */
 
+   /*
+    * Only allow Kerberos if enabled...
+    */
+
+    if (type != CUPSD_AUTH_NEGOTIATE)
+    {
+      cupsdLogClient(con, CUPSD_LOG_ERROR, "Kerberos authentication is not enabled.");
+      return;
+    }
+
 #  ifdef __APPLE__
    /*
     * If the weak-linked GSSAPI/Kerberos library is not present, don't try