Skip to content

protocol: disable connection reuse for SMB(S)#21238

Closed
bagder wants to merge 2 commits into
masterfrom
bagder/smb-no-reuse
Closed

protocol: disable connection reuse for SMB(S)#21238
bagder wants to merge 2 commits into
masterfrom
bagder/smb-no-reuse

Conversation

@bagder

@bagder bagder commented Apr 6, 2026

Copy link
Copy Markdown
Member

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

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
@bagder bagder added the SMB label Apr 6, 2026
@bagder bagder marked this pull request as ready for review April 6, 2026 09:46
@bagder bagder requested a review from Copilot April 6, 2026 09:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Disables connection reuse for SMB/SMBS to avoid incorrect reuse across different SMB shares (given current reuse logic is flawed and SMB is planned for deprecation).

Changes:

  • Remove PROTOPT_CONN_REUSE from the smb scheme definition.
  • Remove PROTOPT_CONN_REUSE from the smbs scheme definition (while retaining PROTOPT_SSL).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/protocol.c Outdated
use PROTOPT_NONE

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@bagder bagder closed this in 74a1695 Apr 7, 2026
@bagder bagder deleted the bagder/smb-no-reuse branch April 7, 2026 11:23
icanhasmath pushed a commit to ActiveState/curl that referenced this pull request May 29, 2026
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.

Reported-by: Osama Hamad
Closes curl#21238

(cherry picked from commit 74a1695)

Backport to 8.17.0 to address CVE-2026-5773 (libcurl could reuse the
wrong SMB(S) connection because the share name was not considered when
matching connections for reuse). 8.17.0 predates the lib/protocol.c
opt-in PROTOPT_CONN_REUSE model used upstream, so instead of clearing
that flag the equivalent effect is achieved by setting
conn->bits.no_reuse = TRUE in smb_setup_connection(); url.c's match
loop rejects any pooled connection with that bit set.
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
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 curl#21238
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants