Homec4science

Lock down accepted next URI values for redirect after login

Authored by epriestley <git@epriestley.com> on Jan 12 2012, 01:07.

Description

Lock down accepted next URI values for redirect after login

Summary:
I locked this down a little bit recently, but make
double-extra-super-sure that we aren't sending the user anywhere suspicious or
open-redirecty. This also locks down protocol-relative URIs (//evil.com/path)
although I don't think any browsers do bad stuff with them in this context, and
header injection URIs (although I don't think any of the modern PHP runtimes are
vulnerable).

Test Plan:

  • Ran tests.
  • Hit redirect page with valid and invalid next URIs; was punted to / for

invalid ones and to the right place for valid ones.

Reviewers: btrahan, jungejason

Reviewed By: btrahan

CC: arice, aran, epriestley, btrahan

Differential Revision: https://secure.phabricator.com/D1369

Details

Committed
epriestley <git@epriestley.com>Jan 13 2012, 20:58
Pushed
aubortJan 31 2017, 17:16
Parents
rPHb71e1c15ef93: Detect which PHP SAPI the CLI binary uses during setup
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHcedb0c045ad7: Lock down accepted next URI values for redirect after login (authored by epriestley <git@epriestley.com>).Jan 13 2012, 20:58