BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
c22e9d8b
Commit
c22e9d8b
authored
Apr 05, 2017
by
Sean McGivern
Committed by
DJ Mountney
Apr 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'open-redirect-fix-continue-to' into 'security'
Fix for open redirect vuln involving continue[to] params See merge request !2083
parent
5f818983
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
continue_params.rb
app/controllers/concerns/continue_params.rb
+1
-0
open-redirect-continue-params.yml
changelogs/unreleased/open-redirect-continue-params.yml
+4
-0
imports_controller_spec.rb
spec/controllers/projects/imports_controller_spec.rb
+8
-1
No files found.
app/controllers/concerns/continue_params.rb
View file @
c22e9d8b
...
...
@@ -7,6 +7,7 @@ module ContinueParams
continue_params
=
continue_params
.
permit
(
:to
,
:notice
,
:notice_now
)
return
unless
continue_params
[
:to
]
&&
continue_params
[
:to
].
start_with?
(
'/'
)
return
if
continue_params
[
:to
].
start_with?
(
'//'
)
continue_params
end
...
...
changelogs/unreleased/open-redirect-continue-params.yml
0 → 100644
View file @
c22e9d8b
---
title
:
Fix for open redirect vulnerability using continue[to] in URL when requesting project import status.
merge_request
:
author
:
spec/controllers/projects/imports_controller_spec.rb
View file @
c22e9d8b
...
...
@@ -96,12 +96,19 @@ describe Projects::ImportsController do
}
end
it
'redirects to params[:to]'
do
it
'redirects to
internal
params[:to]'
do
get
:show
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
,
continue:
params
expect
(
flash
[
:notice
]).
to
eq
params
[
:notice
]
expect
(
response
).
to
redirect_to
params
[
:to
]
end
it
'does not redirect to external params[:to]'
do
params
[
:to
]
=
"//google.com"
get
:show
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
,
continue:
params
expect
(
response
).
not_to
redirect_to
params
[
:to
]
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment