summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYogita Urade <yogita.urade@windriver.com>2025-09-24 15:26:40 +0530
committerSteve Sakoman <steve@sakoman.com>2025-10-03 09:51:17 -0700
commit9c9c70625270baeb44b75d4f12b266758eb9cd38 (patch)
treef810e7be61715f5fa367d939df09bd8ed4881fc0
parentd2a96dd89c0f0c5da62974439d74b7b351c0dbaf (diff)
downloadpoky-9c9c70625270baeb44b75d4f12b266758eb9cd38.tar.gz
curl: fix CVE-2025-9086
1, A cookie is set using the secure keyword for https://target 2, curl is redirected to or otherwise made to speak with http://target (same hostname, but using clear text HTTP) using the same cookie set 3, The same cookie name is set - but with just a slash as path (path="/"). Since this site is not secure, the cookie should just be ignored. 4, A bug in the path comparison logic makes curl read outside a heap buffer boundary The bug either causes a crash or it potentially makes the comparison come to the wrong conclusion and lets the clear-text site override the contents of the secure cookie, contrary to expectations and depending on the memory contents immediately following the single-byte allocation that holds the path. The presumed and correct behavior would be to plainly ignore the second set of the cookie since it was already set as secure on a secure host so overriding it on an insecure host should not be okay. Reference: https://nvd.nist.gov/vuln/detail/CVE-2025-9086 Upstream patch: https://github.com/curl/curl/commit/c6ae07c6a541e0e96d0040afb6 (From OE-Core rev: dc842a631b178acd9c4f00c4a3b87831baf08ebb) Signed-off-by: Yogita Urade <yogita.urade@windriver.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/recipes-support/curl/curl/CVE-2025-9086.patch55
-rw-r--r--meta/recipes-support/curl/curl_7.82.0.bb1
2 files changed, 56 insertions, 0 deletions
diff --git a/meta/recipes-support/curl/curl/CVE-2025-9086.patch b/meta/recipes-support/curl/curl/CVE-2025-9086.patch
new file mode 100644
index 0000000000..8ee7cd5192
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2025-9086.patch
@@ -0,0 +1,55 @@
1From c6ae07c6a541e0e96d0040afb62b45dd37711300 Mon Sep 17 00:00:00 2001
2From: Daniel Stenberg <daniel@haxx.se>
3Date: Mon, 11 Aug 2025 20:23:05 +0200
4Subject: [PATCH] cookie: don't treat the leading slash as trailing
5
6If there is only a leading slash in the path, keep that. Also add an
7assert to make sure the path is never blank.
8
9Reported-by: Google Big Sleep
10Closes #18266
11
12CVE: CVE-2025-9086
13Upstream-Status: Backport [https://github.com/curl/curl/commit/c6ae07c6a541e0e96d0040afb6]
14
15Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
16---
17 lib/cookie.c | 9 +++++----
18 1 file changed, 5 insertions(+), 4 deletions(-)
19
20diff --git a/lib/cookie.c b/lib/cookie.c
21index e287458..ac7d3de 100644
22--- a/lib/cookie.c
23+++ b/lib/cookie.c
24@@ -312,7 +312,7 @@ static char *sanitize_cookie_path(const char *cookie_path)
25 }
26
27 /* convert /hoge/ to /hoge */
28- if(len && new_path[len - 1] == '/') {
29+ if(len > 1 && new_path[len - 1] == '/') {
30 new_path[len - 1] = 0x0;
31 }
32
33@@ -1078,7 +1078,7 @@ Curl_cookie_add(struct Curl_easy *data,
34 if(clist->spath && co->spath) {
35 if(clist->secure && !co->secure && !secure) {
36 size_t cllen;
37- const char *sep;
38+ const char *sep = NULL;
39
40 /*
41 * A non-secure cookie may not overlay an existing secure cookie.
42@@ -1087,8 +1087,9 @@ Curl_cookie_add(struct Curl_easy *data,
43 * "/loginhelper" is ok.
44 */
45
46- sep = strchr(clist->spath + 1, '/');
47-
48+ DEBUGASSERT(clist->spath[0]);
49+ if(clist->spath[0])
50+ sep = strchr(clist->spath + 1, '/');
51 if(sep)
52 cllen = sep - clist->spath;
53 else
54--
552.40.0
diff --git a/meta/recipes-support/curl/curl_7.82.0.bb b/meta/recipes-support/curl/curl_7.82.0.bb
index 623d8a4bc3..54362e6978 100644
--- a/meta/recipes-support/curl/curl_7.82.0.bb
+++ b/meta/recipes-support/curl/curl_7.82.0.bb
@@ -66,6 +66,7 @@ SRC_URI = "https://curl.se/download/${BP}.tar.xz \
66 file://CVE-2024-11053-0001.patch \ 66 file://CVE-2024-11053-0001.patch \
67 file://CVE-2024-11053-0002.patch \ 67 file://CVE-2024-11053-0002.patch \
68 file://CVE-2025-0167.patch \ 68 file://CVE-2025-0167.patch \
69 file://CVE-2025-9086.patch \
69 " 70 "
70SRC_URI[sha256sum] = "0aaa12d7bd04b0966254f2703ce80dd5c38dbbd76af0297d3d690cdce58a583c" 71SRC_URI[sha256sum] = "0aaa12d7bd04b0966254f2703ce80dd5c38dbbd76af0297d3d690cdce58a583c"
71 72