Skip to contentSkip to conversation

curl: Fix CVE-2026-5773 - SMB connection reuse across shares

PATCH In review Jaipaul Cheernam 2 participants 8 messages Jun 23 – Jul 6 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 curl: Fix CVE-2026-5773 - SMB connection reuse across shares

libcurl's SMB handler marks connections for reuse (connkeep) without verifying that subsequent requests target the same share. This allows a second SMB request to the same host to reuse a connection authenticated for a different share, potentially accessing data without proper authorization.

The upstream fix removes connection reuse for SMB entirely in lib/protocol.c, a file introduced in curl 8.20.0. For 8.7.1, the equivalent fix is changing connkeep() to connclose() in lib/smb.c, which prevents the connection from being returned to the pool.

Tested with SMBv1 server (Docker dperson/samba):
Without patch: "Re-using existing connection" for different shares With patch: New connection per request, no reuse

Binary verified: Curl_conncontrol arg changes from 0 (KEEP) to 1 (CLOSE)

Reference: https://curl.se/docs/CVE-2026-5773.html

---
 .../curl/curl/CVE-2026-5773.patch             | 30 +++++++++++++++++++
 meta/recipes-support/curl/curl_8.7.1.bb       |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 meta/recipes-support/curl/curl/CVE-2026-5773.patch
meta/recipes-support/curl/curl/CVE-2026-5773.patch new file +30 -0
new file mode 100644
index 0000000000..a62b389d62
@@ -0,0 +1,30 @@
+From 74a169575d6412dc0ff532acdf94de35a6c2a571 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <[email protected]>
+Date: Sun, 5 Apr 2026 18:23:35 +0200
+Subject: [PATCH] smb: disable connection reuse
+
+Signed-off-by: Daniel Stenberg <[email protected]>
+
+CVE: CVE-2026-5773
+Upstream-Status: Backport [https://github.com/curl/curl/commit/74a169575d6412dc0ff532acdf94de35a6c2a571]
+
+(cherry picked from commit 74a169575d6412dc0ff532acdf94de35a6c2a571)
+Signed-off-by: Jaipaul Cheernam <[email protected]>
+---
+ lib/smb.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/lib/smb.c b/lib/smb.c
+index 7c73cbcec..a1f5c9b31 100644
+--- a/lib/smb.c
++++ b/lib/smb.c
+@@ -461,8 +461,7 @@ static CURLcode smb_connect(struct Curl_easy *data, bool *done)
+   if(!smbc->send_buf)
+     return CURLE_OUT_OF_MEMORY;
+ 
+-  /* Multiple requests are allowed with this connection */
+-  connkeep(conn, "SMB default");
++  connclose(conn, "SMB default");
+ 
+   /* Parse the username, domain, and password */
+   slash = strchr(conn->user, '/');
meta/recipes-support/curl/curl_8.7.1.bb +1 -0
index 14d63d6373..d026731751 100644
@@ -36,6 +36,7 @@ SRC_URI = " \
     file://CVE-2026-1965-2.patch \
     file://CVE-2026-3783.patch \
     file://CVE-2026-3784.patch \
+    file://CVE-2026-5773.patch \
 "
 
 SRC_URI:append:class-nativesdk = " \
Signature · 1 line
2.34.1
#1 lore raw
Quoted 15 lines · Jaipaul Cheernam via lists.openembedded.org

libcurl's SMB handler marks connections for reuse (connkeep) without verifying that subsequent requests target the same share. This allows a second SMB request to the same host to reuse a connection authenticated for a different share, potentially accessing data without proper authorization.

The upstream fix removes connection reuse for SMB entirely in lib/protocol.c, a file introduced in curl 8.20.0. For 8.7.1, the equivalent fix is changing connkeep() to connclose() in lib/smb.c, which prevents the connection from being returned to the pool.

Tested with SMBv1 server (Docker dperson/samba):
Without patch: "Re-using existing connection" for different shares With patch: New connection per request, no reuse

Quoted 6 lines

Binary verified: Curl_conncontrol arg changes from 0 (KEEP) to 1 (CLOSE)

Reference: https://curl.se/docs/CVE-2026-5773.html

---

Hello,

The backported commit is in curl 8.20 but wrynose is only in 8.19. Can you check if the fix is needed for wrynose (and send it there if that is the case)?

Thanks!

Quoted 53 lines
 .../curl/curl/CVE-2026-5773.patch             | 30 +++++++++++++++++++
 meta/recipes-support/curl/curl_8.7.1.bb       |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 meta/recipes-support/curl/curl/CVE-2026-5773.patch
meta/recipes-support/curl/curl/CVE-2026-5773.patch new file +30 -0
new file mode 100644
index 0000000000..a62b389d62
@@ -0,0 +1,30 @@
+From 74a169575d6412dc0ff532acdf94de35a6c2a571 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <[email protected]>
+Date: Sun, 5 Apr 2026 18:23:35 +0200
+Subject: [PATCH] smb: disable connection reuse
+
+Signed-off-by: Daniel Stenberg <[email protected]>
+
+CVE: CVE-2026-5773
+Upstream-Status: Backport [https://github.com/curl/curl/commit/74a169575d6412dc0ff532acdf94de35a6c2a571]
+
+(cherry picked from commit 74a169575d6412dc0ff532acdf94de35a6c2a571)
+Signed-off-by: Jaipaul Cheernam <[email protected]>
+---
+ lib/smb.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/lib/smb.c b/lib/smb.c
+index 7c73cbcec..a1f5c9b31 100644
+--- a/lib/smb.c
++++ b/lib/smb.c
+@@ -461,8 +461,7 @@ static CURLcode smb_connect(struct Curl_easy *data, bool *done)
+   if(!smbc->send_buf)
+     return CURLE_OUT_OF_MEMORY;
+ 
+-  /* Multiple requests are allowed with this connection */
+-  connkeep(conn, "SMB default");
++  connclose(conn, "SMB default");
+ 
+   /* Parse the username, domain, and password */
+   slash = strchr(conn->user, '/');
meta/recipes-support/curl/curl_8.7.1.bb +1 -0
index 14d63d6373..d026731751 100644
@@ -36,6 +36,7 @@ SRC_URI = " \
     file://CVE-2026-1965-2.patch \
     file://CVE-2026-3783.patch \
     file://CVE-2026-3784.patch \
+    file://CVE-2026-5773.patch \
 "
 
 SRC_URI:append:class-nativesdk = " \
Signature · 2 lines
Yoann Congal
Smile ECS
#2 lore raw

Hi Yoann,

I am thinking about curl uplift from 8.19.0 to 8.20.0 in wrynose which will fix below CVEs as well.

Let me know if you have any comment on uplift ?

8.20.0 is a security release fixing 7 CVEs [1]:

* CVE-2026-5773: wrong reuse of SMB connection
* CVE-2026-5545: wrong reuse of HTTP Negotiate connection
* CVE-2026-6253: proxy credentials leak over redirect-to proxy
* CVE-2026-6276: UPLOAD_BUFFERSIZE buffer overflow
* CVE-2026-4873: connection reuse ignores TLS requirement
* CVE-2026-7168: cross-proxy Digest auth state leak
* CVE-2026-6429: netrc credential leak with reused proxy connection

ABI compatible as well.

Regards,
Jaipaul Cheernam

🔗 EST Website<https://www.est.tech/>
🔗 EST LinkedIn<https://www.linkedin.com/company/ericsson-software-technology/>

From: Yoann Congal <[email protected]>
Date: Tuesday, 23 June 2026 at 10:07
To: Jaipaul Cheernam <[email protected]>; [email protected] <[email protected]>
Subject: Re: [OE-core] [scarthgap][PATCH] curl: Fix CVE-2026-5773 - SMB connection reuse across shares

Quoted 15 lines · Jaipaul Cheernam via lists.openembedded.org

libcurl's SMB handler marks connections for reuse (connkeep) without verifying that subsequent requests target the same share. This allows a second SMB request to the same host to reuse a connection authenticated for a different share, potentially accessing data without proper authorization.

The upstream fix removes connection reuse for SMB entirely in lib/protocol.c, a file introduced in curl 8.20.0. For 8.7.1, the equivalent fix is changing connkeep() to connclose() in lib/smb.c, which prevents the connection from being returned to the pool.

Tested with SMBv1 server (Docker dperson/samba):
Without patch: "Re-using existing connection" for different shares With patch: New connection per request, no reuse

Quoted 6 lines

Binary verified: Curl_conncontrol arg changes from 0 (KEEP) to 1 (CLOSE)

Reference: https://curl.se/docs/CVE-2026-5773.html

---

Hello,

The backported commit is in curl 8.20 but wrynose is only in 8.19. Can you check if the fix is needed for wrynose (and send it there if that is the case)?

Thanks!

Quoted 46 lines
 .../curl/curl/CVE-2026-5773.patch             | 30 +++++++++++++++++++
 meta/recipes-support/curl/curl_8.7.1.bb       |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 meta/recipes-support/curl/curl/CVE-2026-5773.patch
meta/recipes-support/curl/curl/CVE-2026-5773.patch new file +30 -0
new file mode 100644
index 0000000000..a62b389d62
@@ -0,0 +1,30 @@
+From 74a169575d6412dc0ff532acdf94de35a6c2a571 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <[email protected]>
+Date: Sun, 5 Apr 2026 18:23:35 +0200
+Subject: [PATCH] smb: disable connection reuse
+
+Signed-off-by: Daniel Stenberg <[email protected]>
+
+CVE: CVE-2026-5773
+Upstream-Status: Backport [https://github.com/curl/curl/commit/74a169575d6412dc0ff532acdf94de35a6c2a571]
+
+(cherry picked from commit 74a169575d6412dc0ff532acdf94de35a6c2a571)
+Signed-off-by: Jaipaul Cheernam <[email protected]>
+---
+ lib/smb.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/lib/smb.c b/lib/smb.c
+index 7c73cbcec..a1f5c9b31 100644
+--- a/lib/smb.c
++++ b/lib/smb.c
+@@ -461,8 +461,7 @@ static CURLcode smb_connect(struct Curl_easy *data, bool *done)
+   if(!smbc->send_buf)
+     return CURLE_OUT_OF_MEMORY;
+
+-  /* Multiple requests are allowed with this connection */
+-  connkeep(conn, "SMB default");
++  connclose(conn, "SMB default");
+
+   /* Parse the username, domain, and password */
+   slash = strchr(conn->user, '/');
meta/recipes-support/curl/curl_8.7.1.bb +0 -0
index 14d63d6373..d026731751 100644

meta/recipes-support/curl/curl_8.7.1.bb SRC_URI = " \ · line 42

Quoted 7 lines
meta/recipes-support/curl/curl_8.7.1.bb +1 -0
@@ -36,6 +36,7 @@ SRC_URI = " \
     file://CVE-2026-1965-2.patch \
     file://CVE-2026-3783.patch \
     file://CVE-2026-3784.patch \
+    file://CVE-2026-5773.patch \
 "
 
 SRC_URI:append:class-nativesdk = " \

--
Yoann Congal
Smile ECS

#3 lore raw
Quoted 16 lines · Jaipaul Cheernam

Hi Yoann,

I am thinking about curl uplift from 8.19.0 to 8.20.0 in wrynose which will fix below CVEs as well.

Let me know if you have any comment on uplift ?

8.20.0 is a security release fixing 7 CVEs [1]:

* CVE-2026-5773: wrong reuse of SMB connection
* CVE-2026-5545: wrong reuse of HTTP Negotiate connection
* CVE-2026-6253: proxy credentials leak over redirect-to proxy
* CVE-2026-6276: UPLOAD_BUFFERSIZE buffer overflow
* CVE-2026-4873: connection reuse ignores TLS requirement
* CVE-2026-7168: cross-proxy Digest auth state leak
* CVE-2026-6429: netrc credential leak with reused proxy connection

Quoted 1 line

ABI compatible as well.

In https://curl.se/ch/8.20.0.html I see:

Quoted 9 lines

Changes:
* async-thrdd: use thread queue for resolving
* build: make NTLM disabled by default
* cmake: drop support for CMake 3.17 and older
* lib: add thread pool and queue
* lib: drop support for < c-ares 1.16.0
* lib: make SMB support opt-in
* multi.h: add CURLMNWC_CLEAR_ALL
* rtmp: drop support

Quickly glancing at it, that look like changes not allowed under our stable policy. Sorry.

Quoted 102 lines

Regards,
Jaipaul Cheernam

🔗 EST Website<https://www.est.tech/>
🔗 EST LinkedIn<https://www.linkedin.com/company/ericsson-software-technology/>

From: Yoann Congal <[email protected]>
Date: Tuesday, 23 June 2026 at 10:07
To: Jaipaul Cheernam <[email protected]>; [email protected] <[email protected]>
Subject: Re: [OE-core] [scarthgap][PATCH] curl: Fix CVE-2026-5773 - SMB connection reuse across shares

Quoted 15 lines · Jaipaul Cheernam via lists.openembedded.org

libcurl's SMB handler marks connections for reuse (connkeep) without verifying that subsequent requests target the same share. This allows a second SMB request to the same host to reuse a connection authenticated for a different share, potentially accessing data without proper authorization.

The upstream fix removes connection reuse for SMB entirely in lib/protocol.c, a file introduced in curl 8.20.0. For 8.7.1, the equivalent fix is changing connkeep() to connclose() in lib/smb.c, which prevents the connection from being returned to the pool.

Tested with SMBv1 server (Docker dperson/samba):
Without patch: "Re-using existing connection" for different shares With patch: New connection per request, no reuse

Quoted 6 lines

Binary verified: Curl_conncontrol arg changes from 0 (KEEP) to 1 (CLOSE)

Reference: https://curl.se/docs/CVE-2026-5773.html

---

Hello,

The backported commit is in curl 8.20 but wrynose is only in 8.19. Can you check if the fix is needed for wrynose (and send it there if that is the case)?

Thanks!

Quoted 46 lines
 .../curl/curl/CVE-2026-5773.patch             | 30 +++++++++++++++++++
 meta/recipes-support/curl/curl_8.7.1.bb       |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 meta/recipes-support/curl/curl/CVE-2026-5773.patch
meta/recipes-support/curl/curl/CVE-2026-5773.patch new file +30 -0
new file mode 100644
index 0000000000..a62b389d62
@@ -0,0 +1,30 @@
+From 74a169575d6412dc0ff532acdf94de35a6c2a571 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <[email protected]>
+Date: Sun, 5 Apr 2026 18:23:35 +0200
+Subject: [PATCH] smb: disable connection reuse
+
+Signed-off-by: Daniel Stenberg <[email protected]>
+
+CVE: CVE-2026-5773
+Upstream-Status: Backport [https://github.com/curl/curl/commit/74a169575d6412dc0ff532acdf94de35a6c2a571]
+
+(cherry picked from commit 74a169575d6412dc0ff532acdf94de35a6c2a571)
+Signed-off-by: Jaipaul Cheernam <[email protected]>
+---
+ lib/smb.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/lib/smb.c b/lib/smb.c
+index 7c73cbcec..a1f5c9b31 100644
+--- a/lib/smb.c
++++ b/lib/smb.c
+@@ -461,8 +461,7 @@ static CURLcode smb_connect(struct Curl_easy *data, bool *done)
+   if(!smbc->send_buf)
+     return CURLE_OUT_OF_MEMORY;
+
+-  /* Multiple requests are allowed with this connection */
+-  connkeep(conn, "SMB default");
++  connclose(conn, "SMB default");
+
+   /* Parse the username, domain, and password */
+   slash = strchr(conn->user, '/');
meta/recipes-support/curl/curl_8.7.1.bb +0 -0
index 14d63d6373..d026731751 100644

meta/recipes-support/curl/curl_8.7.1.bb SRC_URI = " \ · line 42

Quoted 7 lines
meta/recipes-support/curl/curl_8.7.1.bb +1 -0
@@ -36,6 +36,7 @@ SRC_URI = " \
     file://CVE-2026-1965-2.patch \
     file://CVE-2026-3783.patch \
     file://CVE-2026-3784.patch \
+    file://CVE-2026-5773.patch \
 "
 
 SRC_URI:append:class-nativesdk = " \

--
Yoann Congal
Smile ECS

Signature · 2 lines
Yoann Congal
Smile ECS
#4 lore raw

PATCH v2 1/1 curl: fix CVE-2026-5773 - wrong reuse of SMB connection

In reply to Jaipaul Cheernam

libcurl's SMB handler marks connections for reuse (connkeep) without verifying that subsequent requests target the same share. This allows a second SMB request to the same host to reuse a connection authenticated for a different share, potentially accessing data without proper authorization.

The upstream fix removes connection reuse for SMB entirely in lib/protocol.c, a file introduced in curl 8.20.0. For 8.7.1, the equivalent fix is changing connkeep() to connclose() in lib/smb.c, which prevents the connection from being returned to the pool.

Tested with SMBv1 server (Docker dperson/samba):
Without patch: "Re-using existing connection" for different shares With patch: New connection per request, no reuse

Binary verified: Curl_conncontrol arg changes from 0 (KEEP) to 1 (CLOSE)

Reference: https://curl.se/docs/CVE-2026-5773.html

---
 .../curl/curl/CVE-2026-5773.patch             | 41 +++++++++++++++++++
 meta/recipes-support/curl/curl_8.7.1.bb       |  1 +
 2 files changed, 42 insertions(+)
 create mode 100644 meta/recipes-support/curl/curl/CVE-2026-5773.patch
meta/recipes-support/curl/curl/CVE-2026-5773.patch new file +41 -0
new file mode 100644
index 0000000000..0a5fa588fe
@@ -0,0 +1,41 @@
+From 74a169575d6412dc0ff532acdf94de35a6c2a571 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <[email protected]>
+Date: Sun, 5 Apr 2026 18:23:35 +0200
+Subject: [PATCH] protocol: disable connection reuse for SMB(S)
+
+Connections should only be reused when using the same "share" (and
+perhaps some additional conditions), but instead of fixing this flaw,
+this change completely disables connection reuse for SMB. This protocol
+is about to get dropped soon anyway.
+
+Reported-by: Osama Hamad
+Closes #21238
+Signed-off-by: Daniel Stenberg <[email protected]>
+
+CVE: CVE-2026-5773
+Upstream-Status: Backport [https://github.com/curl/curl/commit/74a169575d6412dc0ff532acdf94de35a6c2a571]
+
+Note: The upstream fix targets lib/protocol.c which was introduced in
+curl 8.20.0. In 8.7.1 the equivalent is changing connkeep() to
+connclose() in lib/smb.c, which prevents the connection from being
+returned to the pool. The effect is identical.
+
+Signed-off-by: Jaipaul Cheernam <[email protected]>
+---
+ lib/smb.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/lib/smb.c b/lib/smb.c
+index 7c73cbcec..a1f5c9b31 100644
+--- a/lib/smb.c
++++ b/lib/smb.c
+@@ -461,8 +461,7 @@ static CURLcode smb_connect(struct Curl_easy *data, bool *done)
+   if(!smbc->send_buf)
+     return CURLE_OUT_OF_MEMORY;
+ 
+-  /* Multiple requests are allowed with this connection */
+-  connkeep(conn, "SMB default");
++  connclose(conn, "SMB default");
+ 
+   /* Parse the username, domain, and password */
+   slash = strchr(conn->user, '/');
meta/recipes-support/curl/curl_8.7.1.bb +1 -0
index 14d63d6373..d026731751 100644
@@ -36,6 +36,7 @@ SRC_URI = " \
     file://CVE-2026-1965-2.patch \
     file://CVE-2026-3783.patch \
     file://CVE-2026-3784.patch \
+    file://CVE-2026-5773.patch \
 "
 
 SRC_URI:append:class-nativesdk = " \
Signature · 1 line
2.34.1

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw

Re: [OE-core] [scarthgap][PATCH v2] curl: fix CVE-2026-5773 - wrong reuse of SMB connection

Hi Yoann,

I see that status in patch work shows Changes Requested but I didn’t see any response on this mail thread .

Can you check

Regards,
Jaipaul
________________________________
From: [email protected] <[email protected]> on behalf of Jaipaul Cheernam via lists.openembedded.org <[email protected]>
Sent: Wednesday, June 24, 2026 10:34 AM
To: [email protected] <[email protected]>
Cc: Jaipaul Cheernam <[email protected]>
Subject: [OE-core] [scarthgap][PATCH v2] curl: fix CVE-2026-5773 - wrong reuse of SMB connection

libcurl's SMB handler marks connections for reuse (connkeep) without verifying that subsequent requests target the same share. This allows a second SMB request to the same host to reuse a connection authenticated for a different share, potentially accessing data without proper authorization.

The upstream fix removes connection reuse for SMB entirely in lib/protocol.c, a file introduced in curl 8.20.0. For 8.7.1, the equivalent fix is changing connkeep() to connclose() in lib/smb.c, which prevents the connection from being returned to the pool.

Tested with SMBv1 server (Docker dperson/samba):
Without patch: "Re-using existing connection" for different shares With patch: New connection per request, no reuse

Binary verified: Curl_conncontrol arg changes from 0 (KEEP) to 1 (CLOSE)

Reference: https://curl.se/docs/CVE-2026-5773.html

---
 .../curl/curl/CVE-2026-5773.patch             | 41 +++++++++++++++++++
 meta/recipes-support/curl/curl_8.7.1.bb       |  1 +
 2 files changed, 42 insertions(+)
 create mode 100644 meta/recipes-support/curl/curl/CVE-2026-5773.patch
meta/recipes-support/curl/curl/CVE-2026-5773.patch new file +41 -0
new file mode 100644
index 0000000000..0a5fa588fe
@@ -0,0 +1,41 @@
+From 74a169575d6412dc0ff532acdf94de35a6c2a571 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <[email protected]>
+Date: Sun, 5 Apr 2026 18:23:35 +0200
+Subject: [PATCH] protocol: disable connection reuse for SMB(S)
+
+Connections should only be reused when using the same "share" (and
+perhaps some additional conditions), but instead of fixing this flaw,
+this change completely disables connection reuse for SMB. This protocol
+is about to get dropped soon anyway.
+
+Reported-by: Osama Hamad
+Closes #21238
+Signed-off-by: Daniel Stenberg <[email protected]>
+
+CVE: CVE-2026-5773
+Upstream-Status: Backport [https://github.com/curl/curl/commit/74a169575d6412dc0ff532acdf94de35a6c2a571]
+
+Note: The upstream fix targets lib/protocol.c which was introduced in
+curl 8.20.0. In 8.7.1 the equivalent is changing connkeep() to
+connclose() in lib/smb.c, which prevents the connection from being
+returned to the pool. The effect is identical.
+
+Signed-off-by: Jaipaul Cheernam <[email protected]>
+---
+ lib/smb.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/lib/smb.c b/lib/smb.c
+index 7c73cbcec..a1f5c9b31 100644
+--- a/lib/smb.c
++++ b/lib/smb.c
+@@ -461,8 +461,7 @@ static CURLcode smb_connect(struct Curl_easy *data, bool *done)
+   if(!smbc->send_buf)
+     return CURLE_OUT_OF_MEMORY;
+
+-  /* Multiple requests are allowed with this connection */
+-  connkeep(conn, "SMB default");
++  connclose(conn, "SMB default");
+
+   /* Parse the username, domain, and password */
+   slash = strchr(conn->user, '/');
meta/recipes-support/curl/curl_8.7.1.bb +1 -0
index 14d63d6373..d026731751 100644
@@ -36,6 +36,7 @@ SRC_URI = " \
     file://CVE-2026-1965-2.patch \
     file://CVE-2026-3783.patch \
     file://CVE-2026-3784.patch \
+    file://CVE-2026-5773.patch \
 "
 
 SRC_URI:append:class-nativesdk = " \

--
2.34.1

#7 lore raw

Re: [OE-core] [scarthgap][PATCH v2] curl: fix CVE-2026-5773 - wrong reuse of SMB connection

Quoted 5 lines · Jaipaul Cheernam

Hi Yoann,

I see that status in patch work shows Changes Requested but I didn’t see any response on this mail thread .

Can you check

That look like a mistake on my part, sorry.
I guess I was confused with the wrynose patch geting v3 but not this one.

To avoid that, in the future, you could add a small patch changelog, like you did here:
https://lore.kernel.org/all/[email protected]/

I've re-added the patch into my review queue.

Thanks!

Quoted 97 lines

Regards,
Jaipaul
________________________________
From: [email protected] <[email protected]> on behalf of Jaipaul Cheernam via lists.openembedded.org <[email protected]>
Sent: Wednesday, June 24, 2026 10:34 AM
To: [email protected] <[email protected]>
Cc: Jaipaul Cheernam <[email protected]>
Subject: [OE-core] [scarthgap][PATCH v2] curl: fix CVE-2026-5773 - wrong reuse of SMB connection

libcurl's SMB handler marks connections for reuse (connkeep) without verifying that subsequent requests target the same share. This allows a second SMB request to the same host to reuse a connection authenticated for a different share, potentially accessing data without proper authorization.

The upstream fix removes connection reuse for SMB entirely in lib/protocol.c, a file introduced in curl 8.20.0. For 8.7.1, the equivalent fix is changing connkeep() to connclose() in lib/smb.c, which prevents the connection from being returned to the pool.

Tested with SMBv1 server (Docker dperson/samba):
Without patch: "Re-using existing connection" for different shares With patch: New connection per request, no reuse

Binary verified: Curl_conncontrol arg changes from 0 (KEEP) to 1 (CLOSE)

Reference: https://curl.se/docs/CVE-2026-5773.html

---
 .../curl/curl/CVE-2026-5773.patch             | 41 +++++++++++++++++++
 meta/recipes-support/curl/curl_8.7.1.bb       |  1 +
 2 files changed, 42 insertions(+)
 create mode 100644 meta/recipes-support/curl/curl/CVE-2026-5773.patch
meta/recipes-support/curl/curl/CVE-2026-5773.patch new file +41 -0
new file mode 100644
index 0000000000..0a5fa588fe
@@ -0,0 +1,41 @@
+From 74a169575d6412dc0ff532acdf94de35a6c2a571 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <[email protected]>
+Date: Sun, 5 Apr 2026 18:23:35 +0200
+Subject: [PATCH] protocol: disable connection reuse for SMB(S)
+
+Connections should only be reused when using the same "share" (and
+perhaps some additional conditions), but instead of fixing this flaw,
+this change completely disables connection reuse for SMB. This protocol
+is about to get dropped soon anyway.
+
+Reported-by: Osama Hamad
+Closes #21238
+Signed-off-by: Daniel Stenberg <[email protected]>
+
+CVE: CVE-2026-5773
+Upstream-Status: Backport [https://github.com/curl/curl/commit/74a169575d6412dc0ff532acdf94de35a6c2a571]
+
+Note: The upstream fix targets lib/protocol.c which was introduced in
+curl 8.20.0. In 8.7.1 the equivalent is changing connkeep() to
+connclose() in lib/smb.c, which prevents the connection from being
+returned to the pool. The effect is identical.
+
+Signed-off-by: Jaipaul Cheernam <[email protected]>
+---
+ lib/smb.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/lib/smb.c b/lib/smb.c
+index 7c73cbcec..a1f5c9b31 100644
+--- a/lib/smb.c
++++ b/lib/smb.c
+@@ -461,8 +461,7 @@ static CURLcode smb_connect(struct Curl_easy *data, bool *done)
+   if(!smbc->send_buf)
+     return CURLE_OUT_OF_MEMORY;
+
+-  /* Multiple requests are allowed with this connection */
+-  connkeep(conn, "SMB default");
++  connclose(conn, "SMB default");
+
+   /* Parse the username, domain, and password */
+   slash = strchr(conn->user, '/');
meta/recipes-support/curl/curl_8.7.1.bb +1 -1
index 14d63d6373..d026731751 100644
@@ -36,6 +36,7 @@ SRC_URI = " \
     file://CVE-2026-1965-2.patch \
     file://CVE-2026-3783.patch \
     file://CVE-2026-3784.patch \
+    file://CVE-2026-5773.patch \
 "
 
 SRC_URI:append:class-nativesdk = " \
--

2.34.1

Signature · 2 lines
Yoann Congal
Smile ECS
#8 lore raw

PATCH v3 1/1 curl: fix CVE-2026-5773 - wrong reuse of SMB connection

In reply to Jaipaul Cheernam

libcurl's SMB handler marks connections for reuse (connkeep) without verifying that subsequent requests target the same share. This allows a second SMB request to the same host to reuse a connection authenticated for a different share, potentially accessing data without proper authorization.

The upstream fix removes connection reuse for SMB entirely in lib/protocol.c, a file introduced in curl 8.20.0. For 8.7.1, the equivalent fix is changing connkeep() to connclose() in lib/smb.c, which prevents the connection from being returned to the pool.

Tested with SMBv1 server (Docker dperson/samba):
Without patch: "Re-using existing connection" for different shares With patch: New connection per request, no reuse

Binary verified: Curl_conncontrol arg changes from 0 (KEEP) to 1 (CLOSE)

Reference: https://curl.se/docs/CVE-2026-5773.html

---
 .../curl/curl/CVE-2026-5773.patch             | 40 +++++++++++++++++++
 meta/recipes-support/curl/curl_8.7.1.bb       |  1 +
 2 files changed, 41 insertions(+)
 create mode 100644 meta/recipes-support/curl/curl/CVE-2026-5773.patch
meta/recipes-support/curl/curl/CVE-2026-5773.patch new file +40 -0
new file mode 100644
index 0000000000..42ec2b5a5f
@@ -0,0 +1,40 @@
+From 74a169575d6412dc0ff532acdf94de35a6c2a571 Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <[email protected]>
+Date: Sun, 5 Apr 2026 18:23:35 +0200
+Subject: [PATCH] protocol: disable connection reuse for SMB(S)
+
+Connections should only be reused when using the same "share" (and
+perhaps some additional conditions), but instead of fixing this flaw,
+this change completely disables connection reuse for SMB. This protocol
+is about to get dropped soon anyway.
+
+Reported-by: Osama Hamad
+Closes #21238
+
+CVE: CVE-2026-5773
+Upstream-Status: Backport [https://github.com/curl/curl/commit/74a169575d6412dc0ff532acdf94de35a6c2a571]
+
+Note: The upstream fix targets lib/protocol.c which was introduced in
+curl 8.20.0. In 8.7.1 the equivalent is changing connkeep() to
+connclose() in lib/smb.c, which prevents the connection from being
+returned to the pool. The effect is identical.
+
+Signed-off-by: Jaipaul Cheernam <[email protected]>
+---
+ lib/smb.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/lib/smb.c b/lib/smb.c
+index 7c73cbcec..a1f5c9b31 100644
+--- a/lib/smb.c
++++ b/lib/smb.c
+@@ -461,8 +461,7 @@ static CURLcode smb_connect(struct Curl_easy *data, bool *done)
+   if(!smbc->send_buf)
+     return CURLE_OUT_OF_MEMORY;
+ 
+-  /* Multiple requests are allowed with this connection */
+-  connkeep(conn, "SMB default");
++  connclose(conn, "SMB default");
+ 
+   /* Parse the username, domain, and password */
+   slash = strchr(conn->user, '/');
meta/recipes-support/curl/curl_8.7.1.bb +1 -0
index 14d63d6373..d026731751 100644
@@ -36,6 +36,7 @@ SRC_URI = " \
     file://CVE-2026-1965-2.patch \
     file://CVE-2026-3783.patch \
     file://CVE-2026-3784.patch \
+    file://CVE-2026-5773.patch \
 "
 
 SRC_URI:append:class-nativesdk = " \
Signature · 1 line
2.34.1