Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJoern Schneeweisz <jschneeweisz@gitlab.com>2019-10-22 15:09:57 +0300
committerJoern Schneeweisz <jschneeweisz@gitlab.com>2019-10-22 15:11:26 +0300
commit4b38003d412c6982041c5c3b204d38ed7f53e299 (patch)
tree99ae22cf4562ebf32ae48cf579476b0ce443893c /spec
parent1425a56c75beecaa289ad59587d636f8f469509e (diff)
Use the '\A' and '\z' regex anchors in `InternalRedirect` to mitigate an Open Redirect issue.
Fixes https://dev.gitlab.org/gitlab/gitlabhq/issues/2934 and https://gitlab.com/gitlab-org/gitlab/issues/33569
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/concerns/internal_redirect_spec.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/controllers/concerns/internal_redirect_spec.rb b/spec/controllers/concerns/internal_redirect_spec.rb
index da68c8c8697..e5e50cfd55e 100644
--- a/spec/controllers/concerns/internal_redirect_spec.rb
+++ b/spec/controllers/concerns/internal_redirect_spec.rb
@@ -19,7 +19,8 @@ describe InternalRedirect do
[
'Hello world',
'//example.com/hello/world',
- 'https://example.com/hello/world'
+ 'https://example.com/hello/world',
+ "not-starting-with-a-slash\n/starting/with/slash"
]
end