Add cookie management to HttpClient and improve standards compliance (Content-Type and PRG pattern)#14139
Conversation
bc45e4e to
023c079
Compare
|
Jenkins, test this, please. |
ef48b86 to
9c95a36
Compare
0f9548b to
a82466f
Compare
|
I noticed in commit a946bdb you added a datastore option to configure whether or not cookies are kept. I'm concerned that a user may change that setting to a value that the module author hasn't accounted for and thus break the module. It seems like logic would need to be used to handle this setting and thus it should be left up to the module author. Is there a particular use case you have in mind where that should be left up to the user? |
|
That's fair. I was thinking of removing |
HttpKeepCookies and HttpPartialResponses have been removed.
|
Feels good to remove them! You're right, you can trust users to break things. (: |
|
Jenkins, test this, please. Again. |
smcintyre-r7
left a comment
There was a problem hiding this comment.
I tested this in conjunction with the Exchange ECP DLP exploit (CVE-2020-16875 / PR #14126). Everything is working as intended and my comments have been addressed so I'm going to merge this in. Thanks!
|
FWIW, there were no consumers of |
Release NotesUpdated the HTTP client library that is used by many Metasploit modules to be more compliant across standards in regards to redirection handling. Also added a new feature to more easily manage cookies. |
|
Hope I didn't break |
| # Initialize an empty cookie jar to keep cookies | ||
| self.cookie_jar = Set.new |
There was a problem hiding this comment.
For future travellers, this implementation was superseded by
#14831
Superseded by #14831
Synopsis
Set
opts['keep_cookies']insend_request_cgi(!)to keep cookies from HTTP responses for reuse in HTTP requests.Usage
This is an example from #14126:
Subsequent
send_request_cgi(!)calls will use the cookies in the "cookie jar."Reviewing
The abridged diff might be useful.
Testing
You may test against #14126.
References
Required by #14126. Fixes #12281, #12510, and #12916. See also: #13092.