-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Description
Steps to reproduce:
- Configure OmniAuth to only allow POST requests to
/auth/:provideras discussed in the Resolving CVE-2015-9284 wiki page. - Make a POST request to
/auth/calnet, providing aurlparameter in the request body:
curl -v 'http://localhost:3000/auth/calnet' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'url=https%3A%2F%2Fright.example.test%2F'
Expected:
Locationheader in response includes the provided URLhttps://right.example.test/
Actual:
Locationheader in response does not include anyurlparameter
Location: https://auth-test.berkeley.edu/cas/login?
service=http%3A%2F%2Flocalhost%3A3000%2Fauth%2Fcalnet%2Fcallback%3F
Notes:
The issue is the assumption commented on line 211 here:
omniauth-cas/lib/omniauth/strategies/cas.rb
Lines 210 to 217 in 4ab8a1c
| def return_url | |
| # If the request already has a `url` parameter, then it will already be appended to the callback URL. | |
| if request.params && request.params['url'] | |
| {} | |
| else | |
| { url: request.referer } | |
| end | |
| end |
This only works for GET requests; for POST requests the parameter exists, but was never in in request.query_string to be copied by OmniAuth into the callback URL (see #callback_url and #query_string in OmniAuth::Strategy).
The result is that both the provided url parameter and the Referer header (if provided) are ignored.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels