Skip to content
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

Consolidate HTTP Digest auth header parsing #2156

Open
dmiller-nmap opened this issue Oct 15, 2020 · 1 comment
Open

Consolidate HTTP Digest auth header parsing #2156

dmiller-nmap opened this issue Oct 15, 2020 · 1 comment

Comments

@dmiller-nmap
Copy link

From a mailing list post and the todo/nmap.txt file:

Digest auth support was added to the http library in r29520 (http:https://seclists.org/nmap-dev/2012/q3/517)
but I've just noticed that it doesn't use the existing http.parse_www_authenticate function, but does its own parsing of the header. I'm afraid that the parsing in http.generic_request and sasl.DigestMD5.parseChallenge doesn't look robust. For example, the match "digest.-realm" could match a "realm" that's part of a quoted-string, or even a following auth challenge.

This code should use http.parse_www_authenticate, as it handles things like multiple authentication challenges separated by commas, and is generally more careful. See the http-auth script for an example of using it. http.generic_request should also check for a 401 status code after its first request, and instead of throwing an error, it should just return the page if it gets a 200 or something.

David Fifield

Confirmed that we still use the basic string match and sasl.DigestMD5.parseChallenge. I haven't looked into the 401 status code handling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
@dmiller-nmap and others