diff options
author | Sean McGivern <sean@gitlab.com> | 2017-04-05 22:52:19 +0000 |
---|---|---|
committer | DJ Mountney <david@twkie.net> | 2017-04-05 21:06:58 -0700 |
commit | b80653bb6aa8518e0a61e85cae4430928078c092 (patch) | |
tree | 46d3de9e716c4491fb0e23d6b6790b41f441de2c /spec/controllers/dashboard | |
parent | 0d8fba4eece4fa527dd764472c0e05e1f05f8bc4 (diff) | |
download | gitlab-ce-b80653bb6aa8518e0a61e85cae4430928078c092.tar.gz |
Merge branch 'open-redirect-host-fix' into 'security'
Fix for three open redirect vulns using redirect_to url_for(params.merge)))
See merge request !2082
Diffstat (limited to 'spec/controllers/dashboard')
-rw-r--r-- | spec/controllers/dashboard/todos_controller_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/controllers/dashboard/todos_controller_spec.rb b/spec/controllers/dashboard/todos_controller_spec.rb index 71a4a2c43c7..6075259ea99 100644 --- a/spec/controllers/dashboard/todos_controller_spec.rb +++ b/spec/controllers/dashboard/todos_controller_spec.rb @@ -35,6 +35,13 @@ describe Dashboard::TodosController do expect(assigns(:todos).current_page).to eq(last_page) expect(response).to have_http_status(200) end + + it 'does not redirect to external sites when provided a host field' do + external_host = "www.example.com" + get :index, page: (last_page + 1).to_param, host: external_host + + expect(response).to redirect_to(dashboard_todos_path(page: last_page)) + end end end |