Ignore Content-Length header for the purpose of HEAD requests#17386
Merged
gwillcox-r7 merged 5 commits intorapid7:masterfrom Jan 10, 2023
Merged
Ignore Content-Length header for the purpose of HEAD requests#17386gwillcox-r7 merged 5 commits intorapid7:masterfrom
gwillcox-r7 merged 5 commits intorapid7:masterfrom
Conversation
Contributor
|
For a future reviewer; We'll need to double check the API isn't used by Metasploit Pro internally |
adfoster-r7
reviewed
Dec 20, 2022
…d the original request as an opt
Contributor
|
Before: |
gwillcox-r7
suggested changes
Jan 5, 2023
Contributor
|
Been unable to get this working successfully. This is what I get during testing: |
gwillcox-r7
approved these changes
Jan 10, 2023
Contributor
|
Sees to be working now 🥳 |
Contributor
|
Looks good now @smashery, will land this after the tests pass. Appreciate you fixing this! |
Contributor
Release NotesA bug has been fixed whereby the HTTP library was parsing HTTP HEAD requests like GET requests, which was causing issues due to lack of compliance to RFC9110 standards. By updating the code to be more compliant with these standards, modules such as |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3865, by making our parser more compliant with RFC9110, which states:
"...a client MUST retain knowledge of the request when parsing... a corresponding response. For example, responses to the HEAD method look just like the beginning of a response to GET but cannot be parsed in the same manner."
Previously we did not take into account the request's method, and so were parsing a HEAD response like a GET response.
That turned out to be the root cause of this issue, as was suggested in that issue conversation.
As a result of this fix, the
auxiliary/scanner/http/http_headermodule now works, which has been broken for a while, I gather.Verification
msfconsoleuse auxiliary/scanner/http/http_headerset rhosts google.comrun