Skip to content

Fix following redirects from send_request_cgi!#13448

Merged
acammack-r7 merged 1 commit intorapid7:masterfrom
red0xff:Fix-redirect-http-client
Jun 4, 2020
Merged

Fix following redirects from send_request_cgi!#13448
acammack-r7 merged 1 commit intorapid7:masterfrom
red0xff:Fix-redirect-http-client

Conversation

@red0xff
Copy link
Copy Markdown
Contributor

@red0xff red0xff commented May 13, 2020

closes #13092

Verification

Run the send_request_cgi! method of Msf::Exploit::Remote::HttpClient, with a non-zero redirect depth, where the Location header starts with /, it will no longer start the path from the parent directory of the current server URI, will start from the web root instead.

Copy link
Copy Markdown
Contributor

@acammack-r7 acammack-r7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I think some of the confusion of the initial implementation was that a relative location header is one that does not contain a protocol and host while a relative path name is one that doesn't start from the root.

@acammack-r7 acammack-r7 merged commit 0019104 into rapid7:master Jun 4, 2020
@acammack-r7
Copy link
Copy Markdown
Contributor

Release notes

Metasploit's HTTP client now correctly handles relative redirect URIs that start from the root.

@acammack-r7 acammack-r7 added the rn-fix release notes fix label Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug rn-fix release notes fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

send_request_cgi! does NOT properly follow redirects.

3 participants