Skip to content

test: Add new test to check netrc auth leak #6962

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 5, 2025

Conversation

danigm
Copy link
Contributor

@danigm danigm commented Jun 4, 2025

This patch uses the "hostname" attribute from the parsed url to get the host, instead of trying to calculate the host from netloc that can produce errors when "http://username:password@domain.com" format is used.

This should fix the security issue reported here: CVE-2024-47081: Netrc credential leak in PSF requests library

@sethmlarson
Copy link
Member

@danigm Thanks! The new test is failing on Windows, can you take a peek?

@sigmavirus24
Copy link
Contributor

Can you please rebase as well?

This patch adds a new test that reproduces the security issue reported
here:
https://seclists.org/oss-sec/2025/q2/204

Doing a request to a malicious url with a prefix like "domain.com:@"
will use the "domain.com" netrc credentials in the request to other
domain.
@danigm
Copy link
Contributor Author

danigm commented Jun 5, 2025

I've fixed the windows failure and rebased, so now this patch just adds a new test for netrc because the code fix was added in a different pr: #6965

@danigm danigm changed the title Use hostname for netrc instead split netloc test: Add new test to check netrc auth leak Jun 5, 2025
@Daviey
Copy link

Daviey commented Jun 5, 2025

An example of this vulnerability is available with this intentionally exploitable site, as documented here, https://www.openwall.com/lists/oss-security/2025/06/03/11

@sigmavirus24 sigmavirus24 merged commit 7bc4587 into psf:main Jun 5, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy