Sep 17, 2026·8 min read·117 visits
A session reuse vulnerability in libcurl allows requests with blank Negotiate credentials to hijack previously authenticated connections of other users, bypassing server-side authentication controls entirely.
A critical connection reuse vulnerability exists in curl and libcurl between versions 7.64.1 and 8.21.0 inclusive when Negotiate authentication (SPNEGO) is configured with blank credentials. Because libcurl fails to track changes to the underlying operating system's ambient security context, persistent authenticated connections are incorrectly matched and shared between distinct user sessions, allowing subsequent users to execute requests with the authorization state of the prior user.
The vulnerability CVE-2026-19931 represents a structural flaw in how libcurl maintains and evaluates cached persistent connections authenticated via the Negotiate (SPNEGO) protocol. Under normal operational parameters, libcurl attempts to optimize network efficiency by retaining authenticated connections in an internal connection pool (cpool). When a application initiates a new HTTP request, libcurl inspects this pool to determine if an existing connection to the same endpoint can be safely reused.
This reuse logic depends on matching not only transport parameters like hostnames, ports, and protocols, but also security credentials. If a cached connection is authenticated under User A's identity, libcurl must reject matches for requests issued by User B. However, when Negotiate authentication is initiated with empty or blank credentials (signified by CURLOPT_USERPWD set to ":"), libcurl delegates the authentication challenge to the host operating system's ambient security provider, such as the Security Support Provider Interface (SSPI) on Windows or GSSAPI libraries on Unix-like platforms.
Because libcurl does not actively monitor changes to the ambient security context of the system or the active thread executing the request, it operates under the flawed assumption that all empty-credential requests originate from the same user context. This creates an attack surface in multi-threaded, impersonated, or multi-user applications where the calling security context changes dynamically. In these scenarios, a connection established by a highly privileged user can be matched and reused by a subsequent unprivileged user whose request is routed over the existing, pre-authenticated socket.
To trace the root cause of CVE-2026-19931, it is necessary to examine the evolution of Negotiate connection handling in libcurl. The flaw was introduced in commit 6c6035532383e300c712e4c1cd9fdd749ed5cf59, which decoupled the Negotiate authentication state (negotiatedata) from the transfer-specific structure (UrlState) and attached it directly to the connection-bound structure (connectdata). Prior to this commit, libcurl terminated the underlying TCP connection as soon as a Negotiate-authenticated transfer was complete, neutralizing any possibility of accidental reuse.
The migration of negotiatedata allowed libcurl to preserve established Negotiate TCP connections in the pool. When validating cached connections for potential reuse, libcurl utilizes the internal function url_match_auth_nego(). This function verifies that the authentication configuration of the active request aligns with that of the cached connection. However, the logic contained an explicit bypass: if conn->creds (representing the cached credentials) was evaluated as NULL, the function skipped any rigorous credential comparison, assuming that both connections used the identical, static ambient user context.
In multi-user systems or server-side application environments executing thread-level impersonation, this assumption is false. On Windows platforms, threads may dynamically impersonate distinct security principles via APIs like ImpersonateLoggedOnUser(). Similarly, Unix systems using GSSAPI may swap Kerberos credential caches (indicated by the KRB5CCNAME environment variable) between operations. Because the libcurl engine is blind to these external operating system-level state transitions, it incorrectly considers any two requests utilizing "blank credentials" as structurally equivalent. When User B issues a request to the same target host, the caching engine identifies the host match, evaluates conn->creds == NULL, ignores the identity divergence, and assigns User B's transfer to the socket authenticated as User A.
The remediation of this flaw was committed by Stefan Eissing in commit 7103a93b05bc69ea98ed9d05d02fa9eeba533f2f. The security patch addresses an architectural error in how libcurl handles connection management. Previously, connection maintenance tasks (such as connection pool upkeep, liveliness checks, and eviction strategies) were executed directly on the application handle (data) supplied by the calling thread. This pattern caused the application handle to temporarily bind to connections it was not actively utilizing, altering the state trackers and breaking the validation logic of data->state.recent_conn_id.
By running maintenance routines on the calling transfer handle, libcurl created a race and corruption scenario in connection matching. The patch introduces a dedicated, internal admin handle exclusively for administrative and maintenance operations, ensuring that user transfers never interact with or pollute the states of inactive cached connections. This separation preserves the integrity of recent_conn_id tracking, ensuring that connections are only eligible for reuse if they perfectly align with the calling user's isolated context.
// Conceptual representation of the fix in connection state binding
// BEFORE THE PATCH:
// Connection cleanup and maintenance routines were run on the active user context 'data'.
// This allowed state overlap and corrupts the connection validation markers.
CURLcode Curl_conn_cache_maintenance(struct Curl_easy *data) {
// State modification occurs on user-controlled handle
data->state.recent_conn_id = ...;
return CURLE_OK;
}
// AFTER THE PATCH:
// Maintenance is isolated using an internal administrative handle ('admin_data').
// User-specific transfer contexts remain completely separated from idle pooled sockets.
CURLcode Curl_conn_cache_maintenance(struct Curl_easy *admin_data) {
if(admin_data->internal_admin_handle) {
// Execute maintenance without touching active user handle states
perform_maintenance_tasks(admin_data);
}
return CURLE_OK;
}Additionally, this fix prevents the session-matching bypass because the internal states are no longer scrambled by background eviction loops. By maintaining strict separation of administrative contexts, the socket validation engine can reliably enforce credential verification boundaries.
Exploitation of CVE-2026-19931 does not require complex cryptographic attacks or memory corruption payloads; instead, it relies on the predictable behavior of the connection matching engine. The exploit scenario operates in environments where libcurl is integrated into a multi-threaded daemon, a web application gateway, or a middleware service that performs actions on behalf of multiple users using Integrated Windows Authentication (IWA) or Kerberos SSO.
To trigger the session hijack, an attacker must satisfy the following prerequisites:
CURLOPT_HTTPAUTH set to CURLAUTH_NEGOTIATE).CURLOPT_USERPWD set to ":"), thereby delegating to ambient Kerberos/GSSAPI contexts.Keep-Alive).The attack flow begins when User A (with high-level privileges) triggers an action. The application, impersonating User A, initiates a request through libcurl. The underlying GSSAPI/SSPI provider generates the required token, completes the handshake, and authenticates the TCP connection. The transaction finishes, and libcurl returns the connection to the pool. Next, User B (the attacker) initiates a transaction to the same server. The application switches thread context to User B and triggers a libcurl request. libcurl queries the pool, finds User A's idle, authenticated connection, matches it due to the NULL credential check bypass, and routes User B's request over it. The server processes User B's request under User A's identity, resulting in unauthenticated privilege escalation.
The impact of CVE-2026-19931 is rated Critical, with a CVSS v3.1 Base Score of 9.8. This score reflects the complete compromise of confidentiality, integrity, and availability within the trust boundary established between the client application and the backend service.
Because the session reuse bypass occurs entirely at the protocol transport layer within libcurl, security logging on the target server will not record any anomaly during the attack. The server simply receives a standard HTTP request over an already established, trusted TCP session that was authenticated during the initial SPNEGO handshake. Consequently, audit trails will attribute the attacker's unauthorized activities to the victim (User A), complicating incident response and forensics analysis.
In corporate environments, where Negotiate/Kerberos authentication is standard for single sign-on (SSO) to intranet portals, document management systems, and administrative APIs, this vulnerability exposes backend infrastructures to complete compromise. An attacker with low-privileged access to an application server can hijack active administrative connections to execute arbitrary state modifications, extract sensitive database files, or disable system availability.
The primary resolution for CVE-2026-19931 is upgrading the libcurl binary to version 8.22.0 or higher. For deployments where legacy or enterprise-stable releases are required, organizations must apply backported security updates containing the fix, such as versions 8.20.1, 8.16.1, or 8.14.2.
If compiling from source or updating packages is not immediately feasible, developers can apply an application-level workaround. This workaround prevents libcurl from caching or reusing persistent connections that utilize Negotiate authentication. By setting the CURLOPT_FORBID_REUSE parameter to 1L on every easy handle that performs Negotiate requests with blank credentials, the library is forced to close the TCP connection immediately upon completion of the transfer. This eliminates the risk of pool pollution and unauthorized reuse.
// Secure implementation of ambient Negotiate authentication to mitigate CVE-2026-19931
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://internal-api.corp.local/data");
// Configure SPNEGO / Negotiate authentication
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_NEGOTIATE);
// Explicitly use blank credentials for ambient user context delegation
curl_easy_setopt(curl, CURLOPT_USERPWD, ":");
// MITIGATION: Disable socket persistence to prevent downstream connection reuse hijacking
curl_easy_setopt(curl, CURLOPT_FORBID_REUSE, 1L);
CURLcode res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}Security teams should also review authorization structures on the backend servers. Where possible, configuring the backend to require re-authentication per request (by disabling HTTP Keep-Alive or using transaction-scoped tokens) can serve as an additional defense-in-depth measure.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
curl curl | >= 7.64.1, <= 8.21.0 | 8.22.0 |
libcurl curl | >= 7.64.1, <= 8.21.0 | 8.22.0 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-488 (Exposure of Data Element to Wrong Session) |
| Attack Vector | Network (AV:N) |
| CVSS v3.1 Score | 9.8 (Critical) |
| EPSS Score | 0.01162 (Percentile: 65.60%) |
| Exploit Status | Proof-of-Concept / Analysis |
| CISA KEV Status | Not Listed |
| Affected Version Range | 7.64.1 to 8.21.0 |
The product associates a system resource or data element with the incorrect session, leading to exposure of information or control to an unauthorized user.
CVE-2026-126300 (GHSA-ffr9-mgrr-wcvr) is an inefficient algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) Python library affecting versions 3.2.5 prior to 3.10.4. The flaw resides in the quote-restoration routine of TreebankWordTokenizer.span_tokenize and NLTKWordTokenizer.span_tokenize, where repeated calls to list.pop(0) over matched quote tokens introduce quadratic O(n^2) time complexity. An unauthenticated remote attacker who supplies input containing long sequences of double-quote characters can exhaust CPU resources and degrade service availability.
The Natural Language Toolkit (NLTK) versions 3.6 through 3.10.3 contain an algorithmic complexity vulnerability in the LegalitySyllableTokenizer.tokenize method. When processing tokens composed of continuous runs of vowels, an unguarded string reversal and set membership lookup loop executes in quadratic time relative to the input token length. Remote attackers capable of submitting arbitrary text to applications utilizing this tokenizer can trigger sustained single-core CPU exhaustion and application-level denial of service.
CVE-2026-126304 is a symlink path traversal vulnerability (CWE-59) in the Natural Language Toolkit (NLTK) versions 3.10.0 prior to 3.10.4. The YCOECorpusReader class constructs internal sub-readers for the 'psd' and 'pos' subdirectories using FileSystemPathPointer.join(), which relies exclusively on lexical string-prefix validation rather than canonical path resolution. An attacker who supplies a crafted YCOE corpus containing symbolic links in place of the 'psd' or 'pos' subdirectories can bypass directory confinement and read arbitrary files from sibling corpora or sensitive directories within the NLTK data sandbox.
CVE-2026-128077 (GHSA-r99w-jh2x-3mg9) is an authorization bypass and interpretation conflict vulnerability affecting Nuxt and its underlying @nuxt/nitro-server package in versions 4.6.0 through 4.6.3. When an incoming HTTP request path begins with a double forward slash (e.g., //x/admin), the WHATWG URL parser within the Nuxt server-side page renderer interprets the initial segment as a network host/authority and resolves the remaining path (/admin) against the application's page router. Because Nitro server middleware, route-scoped serverHandlers, and Nitro routeRules evaluate the unparsed request path (//x/admin), path-based access controls, redirects, and security header policies configured for /admin fail to match and are bypassed.
Prior to version 2.10.2, the sqlite3-ruby gem explicitly cast 64-bit Ruby string lengths (long) to 32-bit signed integers (int) when invoking the underlying SQLite C API. On 64-bit platforms, providing a string of 4 GiB (2^32 bytes) or larger causes integer truncation, instructing SQLite to process only a prefix of the string. This flaw affects SQL query preparation, bound parameter values, and return values from custom Ruby-defined SQL functions and aggregates, allowing trailing SQL clauses such as WHERE restrictions to be silently dropped under specific conditions.
CVE-2026-128068 (GHSA-cpgf-5mjf-73p7) is a Regular Expression Denial of Service (ReDoS) vulnerability in the rails-html-sanitizer Ruby gem affecting versions 1.0.3 through 1.7.1. The flaw resides in the Rails::HTML::PermitScrubber#scrub_attribute method, which uses the multiline regular expression /^\s*[^#\s].*/m to enforce local-only URI fragment references on SVG elements. On Ruby runtimes prior to version 3.2 (CRuby <= 3.1 and JRuby), evaluating an attribute value composed of repeated newline and whitespace characters without a hash character triggers quadratic backtracking O(n^2). Applications are only vulnerable if their sanitization allowlist is explicitly configured to permit SVG reference elements such as <use> alongside href or xlink:href attributes.