CVE-2026-19931: Negotiate ambient user conn reuse
In curl 8.21.0 on Windows with SSPI/Negotiate, a connection authenticated using ambient credentials could be reused for a later request that supplied different explicit credentials. This meant a request configured for one user could be processed by the server as the previously authenticated identity.
- Triaged in 3 days
- Fixed in 26 days
- Disclosed after 27 days
Summary
On Windows with SSPI/Negotiate, curl 8.21.0 can reuse a connection authenticated with ambient credentials for a later request using different explicit credentials.
In url_match_auth_nego(), the credential comparison is skipped when conn->creds == NULL. This allows a connection authenticated as one identity to be reused for a request configured with another identity. In my reproducer, request A authenticates as Administrator, request B supplies credentials for userB, but the server processes B as Administrator.
curl 8.20.0 does not reproduce this issue.
Affected version
Reproduced with libcurl 8.21.0 on Windows using SSPI/SPNEGO.
Root cause
In 8.21.0:
if(m->want_nego_http) {
if(conn->creds &&
(!Curl_creds_same(conn->creds, m->data->state.creds) ||
!Curl_peer_equal(conn->creds_origin, m->data->state.origin)))
return FALSE;
}
The credential/origin comparison is only performed when conn->creds is non-NULL. Connections authenticated through ambient SSPI credentials can have conn->creds == NULL, so the check is skipped.
Steps To Reproduce
- Run the attached local Windows Negotiate server.
- Run the PoC as Windows user A (
Administratorin my test). - Request A uses
CURLAUTH_NEGOTIATEwithout explicit credentials. - Request B uses another easy handle on the same
CURLMwith explicit credentials foruserB. - On curl 8.21.0, request B reuses A's connection.
Observed:
8.20.0:
A default -> Administrator
B explicit userB -> userB
8.21.0:
A default -> Administrator
B explicit userB -> Administrator
Disabling connection reuse causes B to authenticate correctly as userB.
Attached:
poc.c- minimal libcurl reproducerserver.cs- minimal local Negotiate server
Impact
A request configured for one user may execute using the identity of a previously authenticated pooled connection.
Suggested fix
The credential/origin comparison should depend on whether the connection has entered Negotiate authentication state, rather than whether conn->creds is non-NULL:
if(m->want_nego_http) {
- if(conn->creds &&
+ if((conn->http_negotiate_state != GSS_AUTHNONE) &&
(!Curl_creds_same(conn->creds, m->data->state.creds) ||
!Curl_peer_equal(conn->creds_origin, m->data->state.origin)))
return FALSE;
}
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The connection-reuse check compared credentials only when the stored connection credentials were non-NULL, but ambient SSPI authentication leaves them NULL, so the comparison was skipped.
Impact
A request configured for one user may execute using the identity of a previously authenticated pooled connection.
What the attacker needed
Windows with SSPI/Negotiate; libcurl 8.21.0; connection reuse enabled; ambient credentials available
The fix
The credential and origin comparison should depend on whether the connection has entered Negotiate authentication state rather than on whether the stored credentials are non-NULL.
How it was found
- Run the local Windows Negotiate server.
- Run the proof-of-concept as Windows user A.
- Send request A using Negotiate without explicit credentials.
- Send request B on the same multi handle with explicit credentials for userB.
- Observe that request B reuses A's connection and is processed as user A.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a program talks to a server, it can keep the connection open and reuse it for later requests to save time. This report shows that curl sometimes reused a connection that had been logged in as one user for a request meant to be a different user, so the server saw the wrong person. That matters because actions could be taken with someone else's permissions.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.