[PATCH] curl_sasl: if redirected, require permission to use bearer
authorDaniel Stenberg <daniel@haxx.se>
Wed, 10 Dec 2025 10:40:47 +0000 (11:40 +0100)
committerSamuel Henrique <samueloph@debian.org>
Fri, 8 May 2026 14:16:21 +0000 (07:16 -0700)
Closes #19933

Backported-by: Samuel Henrique <samueloph@debian.org>
 * Refresh patch context for lib/curl_sasl.c

Backported by: Samuel Henrique <samueloph@debian.org>
 * Refresh line numbers for bookworm 7.88.1: same functions
   (Curl_sasl_start and Curl_sasl_continue), -7 line offset.

Gbp-Pq: Name CVE-2025-14524.patch

lib/curl_sasl.c

index 119fb9b25a23efc62e7fae90343c25679b102810..2dd6b00b9c94e184fe6404d3be304209826e842b 100644 (file)
@@ -349,7 +349,10 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct Curl_easy *data,
     data->set.str[STRING_SERVICE_NAME] :
     sasl->params->service;
 #endif
-  const char *oauth_bearer = data->set.str[STRING_BEARER];
+  const char *oauth_bearer =
+    (!data->state.this_is_a_follow || data->set.allow_auth_to_other_hosts) ?
+    data->set.str[STRING_BEARER] : NULL;
+
   struct bufref nullmsg;
 
   Curl_conn_get_host(data, FIRSTSOCKET, &hostname, &disp_hostname, &port);
@@ -536,7 +539,10 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct Curl_easy *data,
     data->set.str[STRING_SERVICE_NAME] :
     sasl->params->service;
 #endif
-  const char *oauth_bearer = data->set.str[STRING_BEARER];
+  const char *oauth_bearer =
+    (!data->state.this_is_a_follow || data->set.allow_auth_to_other_hosts) ?
+    data->set.str[STRING_BEARER] : NULL;
+
   struct bufref serverdata;
 
   Curl_conn_get_host(data, FIRSTSOCKET, &hostname, &disp_hostname, &port);