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/app
diff options
context:
space:
mode:
authorGitLab Release Tools Bot <robert+release-tools@gitlab.com>2019-10-24 21:53:41 +0300
committerGitLab Release Tools Bot <robert+release-tools@gitlab.com>2019-10-24 21:53:41 +0300
commit19c5bdd7cc3908f40c284c51c75e5b6f69048c15 (patch)
tree7defa31e9ea53aa1c2bf0eda88078864d8931783 /app
parent89183bfdfb46d552fe26112d999c2eb74d3ec94e (diff)
parent811b7247dd77449d9fd4106e5ed48019e6ec5461 (diff)
Merge branch 'security-open-redirect-internalredirect-12-2' into '12-2-stable'
Use the '\A' and '\z' regex anchors in `InternalRedirect` to mitigate an Open Redirect issue. See merge request gitlab/gitlabhq!3476
Diffstat (limited to 'app')
-rw-r--r--app/controllers/concerns/internal_redirect.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/concerns/internal_redirect.rb b/app/controllers/concerns/internal_redirect.rb
index fa3716502a0..e314953bb79 100644
--- a/app/controllers/concerns/internal_redirect.rb
+++ b/app/controllers/concerns/internal_redirect.rb
@@ -6,7 +6,7 @@ module InternalRedirect
def safe_redirect_path(path)
return unless path
# Verify that the string starts with a `/` and a known route character.
- return unless path =~ %r{^/[-\w].*$}
+ return unless path =~ %r{\A/[-\w].*\z}
uri = URI(path)
# Ignore anything path of the redirect except for the path, querystring and,