File: auth-digest-Handle-missing-nonce-1.patch

package info (click to toggle)
libsoup3 3.2.3-0%2Bdeb12u2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 7,496 kB
  • sloc: ansic: 60,347; python: 202; xml: 97; sh: 84; makefile: 25; javascript: 5
file content (37 lines) | stat: -rw-r--r-- 1,796 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From: Patrick Griffis <pgriffis@igalia.com>
Date: Wed, 5 Feb 2025 14:03:05 -0600
Subject: auth-digest: Handle missing nonce

Origin: upstream, 3.6.5, commit:cd077513f267e43ce4b659eb18a1734d8a369992
Bug: https://gitlab.gnome.org/GNOME/libsoup/-/issues/434
Bug-CVE: https://security-tracker.debian.org/tracker/CVE-2025-32912
---
 libsoup/auth/soup-auth-digest.c | 2 +-
 tests/auth-test.c               | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/libsoup/auth/soup-auth-digest.c b/libsoup/auth/soup-auth-digest.c
index 9eb7fa0..d69a401 100644
--- a/libsoup/auth/soup-auth-digest.c
+++ b/libsoup/auth/soup-auth-digest.c
@@ -162,7 +162,7 @@ soup_auth_digest_update (SoupAuth *auth, SoupMessage *msg,
 	guint qop_options;
 	gboolean ok = TRUE;
 
-        if (!soup_auth_get_realm (auth))
+        if (!soup_auth_get_realm (auth) || !g_hash_table_contains (auth_params, "nonce"))
                 return FALSE;
 
 	g_free (priv->domain);
diff --git a/tests/auth-test.c b/tests/auth-test.c
index c651c7c..484097f 100644
--- a/tests/auth-test.c
+++ b/tests/auth-test.c
@@ -1952,6 +1952,7 @@ main (int argc, char **argv)
         g_test_add_data_func ("/auth/missing-params/realm", "Digest qop=\"auth\"", do_missing_params_test);
         g_test_add_data_func ("/auth/missing-params/nonce", "Digest realm=\"auth-test\", qop=\"auth,auth-int\", opaque=\"5ccc069c403ebaf9f0171e9517f40e41\"", do_missing_params_test);
         g_test_add_data_func ("/auth/missing-params/nonce-md5-sess", "Digest realm=\"auth-test\", qop=\"auth,auth-int\", opaque=\"5ccc069c403ebaf9f0171e9517f40e41\" algorithm=\"MD5-sess\"", do_missing_params_test);
+        g_test_add_data_func ("/auth/missing-params/nonce-and-qop", "Digest realm=\"auth-test\"", do_missing_params_test);
 
 	ret = g_test_run ();