martini-contrib / oauth2

[not maintained] Allows your Martini application to support user login via an OAuth 2.0 backend.
Apache License 2.0
125 stars 47 forks source link

Fixes issue with unvalidated redirects in next parameter #12

Closed tomsteele closed 10 years ago

tomsteele commented 10 years ago

Currently the next query parameter allows for unvalidated redirects. An attacker can send a link to a user containing a complete URL, such as "http://maritini.com/logout?next=http://evil.com". Since next is not validated, the user will be sent to "http://evil.com".

To solve this I added an extractPath function which attempts to parse the next variable and return its Path. If there is an error parsing it returns "/"

rakyll commented 10 years ago

Good catch! Thanks.