Skip to content
Access control Disclosed report Advanced CVE-2026-3784

CVE-2026-3784: wrong proxy connection reuse with credentials

libcurl's proxy connection matcher compared proxy type, host and port but not the proxy username or password, so a transfer with different proxy credentials could reuse an already authenticated CONNECT tunnel. An attacker able to submit transfers to a service with a shared connection cache could therefore reach destinations through a proxy without valid credentials.

xaksaskookqdo Follow

Originally disclosed on HackerOne

  • Triaged in 48 hours
  • Fixed in 7 days
  • Disclosed after 7 days

Summary

libcurl may reuse an existing HTTP proxy CONNECT tunnel without matching proxy credentials when selecting a reusable connection. In lib/url.c, url_match_proxy_use() calls proxy_info_matches() (lib/url.c:930-935 → lib/url.c:589-595), and that matcher compares proxy type, host, and port but does not compare proxy username or password. When a shared connection cache is used (CURLSH + CURL_LOCK_DATA_CONNECT), a transfer using different proxy credentials can reuse a previously authenticated tunnel. In my reproduction the proxy receives only one CONNECT request with good:good, while a second transfer configured with bad:bad succeeds through the existing tunnel without issuing a new CONNECT. This was reproduced both with sequential libcurl transfers and with a wrapper/daemon model where multiple clients submit jobs to a process holding the shared connection cache. Control tests show the issue does not occur when connections are not shared (noshare) or when the destination host differs.

Affected version Reproduced on: curl 8.18.0 (x86_64-pc-linux-gnu) libcurl/8.18.0 OpenSSL/3.5.5 zlib/1.3.1 brotli/1.2.0 zstd/1.5.7 libidn2/2.3.8 libpsl/0.21.2 libssh2/1.11.1 nghttp2/1.64.0 ngtcp2/1.16.0 nghttp3/1.12.0 librtmp/2.3 mit-krb5/1.22.1 OpenLDAP/2.6.10

Release information: Release-Date: 2026-01-07 security patched: 8.18.0-2 Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM PSL SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd

Steps To Reproduce

  1. Build the PoC program using libcurl.
  2. Start the local proxy reproducer script.

python3 /tmp/run_share_connect_poc.py 3. The script performs two transfers via a proxy.

Transfer 1: proxy credentials: good:good Transfer 2: proxy credentials: bad:bad

MODE noshare

  • first request succeeds
  • second request fails with proxy authentication error
  • proxy observes two CONNECT requests

MODE share

  • both requests succeed
  • proxy observes only one CONNECT request
  • CONNECT uses good:good
  • second request (bad:bad) is sent through existing tunnel

Run the wrapper daemon scenario (curl_wrap_daemon.c) to simulate a service using a shared connection pool. The second client using bad:bad credentials still succeeds while the proxy sees only the original CONNECT.

Impact

When applications share a libcurl connection cache using CURLSHOPT_SHARE with CURL_LOCK_DATA_CONNECT, proxy authentication contexts can be mixed across requests.

A transfer specifying invalid proxy credentials may reuse a previously authenticated CONNECT tunnel established with different credentials.

In multi-tenant architectures or wrapper/daemon services that reuse a shared connection pool, this can allow requests to bypass proxy authentication policy enforcement.

Attachments

Screenshot_2026-03-04_202501.png
Screenshot_2026-03-04_202501.png From the original on HackerOne
Screenshot_2026-03-04_202431.png
Screenshot_2026-03-04_202431.png

The original report as published on HackerOne, by xaksaskookqdo. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

Likely the proxy-connection matching function omits the proxy username and password from its comparison, so tunnels are treated as interchangeable regardless of the credentials used to create them.

Impact

In multi-tenant or daemon services that share a connection pool, requests could bypass proxy authentication policy enforcement; the issue does not occur when connections are not shared or when the destination host differs.

What the attacker needed

Shared connection cache (CURLSH); attacker can submit transfers to the service; proxy requires authentication

The fix

The proxy connection matcher should also compare the proxy username and password before allowing a tunnel to be reused; the text lists a patched build but does not describe the code change.

How it was found

  1. Build a proof-of-concept program using libcurl.
  2. Start the local proxy reproducer script.
  3. Run two transfers through the proxy, the first with valid credentials and the second with invalid ones.
  4. Compare the noshare mode, where the second transfer fails and two CONNECT requests are seen, with the share mode, where both succeed and only one CONNECT is seen.
  5. Run the wrapper daemon scenario to simulate a service using a shared connection pool.

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.

A proxy is a middlebox that sits between a program and the internet and can demand a username and password before letting traffic through. libcurl can keep connections open for reuse, and when several transfers share that pool it picked an old tunnel based only on the proxy's address, not on who authenticated it. So a request with wrong credentials rode on a tunnel someone else had already opened.

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.

More from curl

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.