CVE-2025-0167: netrc and default credential leak
The fix for CVE-2024-11053 was incomplete: when a netrc file contains a 'default' entry, curl still sends the credentials from a specific machine entry to a different host. An attacker who can influence which host curl connects to could obtain credentials meant for another server.
Originally disclosed on HackerOne
- Triaged in 19 hours
- Fixed in 37 days
- Disclosed after 39 days
Summary:
The fix for CVE-2024-11053 seems to be incomplete.The information leak problem could be reproduced again if use netrc in step1.
Affected version
all
Steps To Reproduce:
- Adapt test479 to use netrc like below(both of user and password are not provided for b.com):
machine a.com login alice password alicespassword
default
2.Run test479 3. The test would fail because alice and alicepassword were used for b.com.
I used the latest version curl 8.11.1 but the problem still exists.I'm not sure if this is expected.Please point it out if i'm wrong.
Impact
Summary:
Sensitive information disclosure.
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 netrc parsing logic applies a 'default' entry without properly clearing or scoping credentials that were set for a previous machine entry.
Impact
Sensitive credentials could be disclosed to the wrong server, though the report does not demonstrate a full attack beyond the test failure.
What the attacker needed
Curl uses a netrc file; netrc has a machine entry and a default entry; curl connects to a different host
The fix
The netrc handling should be corrected so a default entry does not inherit credentials from a previous machine entry.
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 netrc file stores login details for different servers. curl reads it to know which username and password to use for each host. The bug is that a catch-all 'default' entry causes curl to reuse credentials from one server when talking to a different one, so the wrong server receives someone else's password.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.