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

Added module for WSO2 API Manager Documentation File Upload Remote Co… #19647

Merged
merged 14 commits into from
Dec 16, 2024
Prev Previous commit
Next Next commit
Fix: Handle full-location redirects in send_request_cgi
- Resolved an issue where redirects with full-location URLs were not properly handled by `send_request_cgi`.
- Implemented a quick solution for now; open to suggestions for a more robust approach.
- Tested behavior without proxy interference, as Burp previously masked the issue.
  • Loading branch information
heyder committed Dec 4, 2024
commit 964261283b34d069c0a5df50d72055896f46fe40
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,22 @@ def authenticate
while res.redirect?
loop_dectector += 1
res = send_request_cgi(
'uri' => res.redirection.to_s,
'uri' => "#{res.redirection.path}?#{res.redirection.query}",
'method' => 'GET',
'headers' => {
'Connection' => 'keep-alive'
},
'keep_cookies' => true
)

if res&.get_cookies && res.get_cookies.match(/sessionNonceCookie-(.*)=/)
heyder marked this conversation as resolved.
Show resolved Hide resolved
vprint_status('Got session nonce')
nounce = ::Regexp.last_match(1)
end
break if nounce

fail_with(Failure::UnexpectedReply, 'Loop detected') if loop_dectector > 3

end

auth_data = {
Expand All @@ -192,7 +195,7 @@ def authenticate
while res.redirect?
loop_dectector += 1
res = send_request_cgi(
'uri' => res.redirection.to_s,
'uri' => "#{res.redirection.path}?#{res.redirection.query}",
'method' => 'GET',
'headers' => {
'Connection' => 'keep-alive'
Expand Down
Loading