libcurl Wrong Connection Reuse Vulnerability in SMB Transfers

Vulnerability

A vulnerability exists in libcurl versions 7.40.0 through 8.19.0, where the library may incorrectly reuse SMB connections for transfers. This issue arises because libcurl maintains a pool of recent connections to reduce overhead, but a logical error allows a transfer to reuse a connection that is linked to a different 'share' on the same server. As a result, this flaw could lead to downloading the wrong file or uploading a file to an incorrect location, all while using the same credentials and server name.

Impact

Exploitation of this vulnerability can cause data spoofing by allowing an attacker to replace expected files with malicious ones, bypassing application-level URL restrictions. This could lead to processing sensitive information as untrusted data, potentially causing server-side request forgery (SSRF) or executing arbitrary code, depending on how the application handles the files.

Reproduction

The vulnerability can be reproduced by setting up a Samba server with two shares, 'share1' and 'share2'. After creating the shares and adding files to them, the issue can be demonstrated by using curl to sequentially request files from both shares. Due to the connection reuse flaw, curl will fetch the file from 'share1' when 'share2' is requested, effectively spoofing the data.

Remediation

Users are advised to upgrade to curl and libcurl version 8.20.0, where this vulnerability has been fixed. Alternatively, the patch can be applied manually and libcurl rebuilt.

Added: May 13, 2026, 4:23 PM
Updated: May 13, 2026, 4:23 PM

Vulnerability Rating

Custom Algorithm
spread
8.4
impact
1.3
exploitability
6.0
remediation
8.3
relevance
8.3
threat
6.4
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.