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/lib
diff options
context:
space:
mode:
authorGitLab Release Tools Bot <robert+release-tools@gitlab.com>2019-06-27 00:40:51 +0300
committerGitLab Release Tools Bot <robert+release-tools@gitlab.com>2019-06-27 00:40:51 +0300
commit1c7019fcbd4ce8216d64fd5dd392ce8de8c9a98e (patch)
tree2a2b54a64619245d0b55e9003bbb176a71412189 /lib
parent0279476e55b16bc43c9bce0c45831570c9e1d51f (diff)
parente639f476ba83157ae9e66d080f8405daacfbbd56 (diff)
Merge branch 'security-DOS_issue_comments_banzai-12-0' into '12-0-stable'
Fix DOS when rendering issue/MR comments See merge request gitlab/gitlabhq!3171
Diffstat (limited to 'lib')
-rw-r--r--lib/banzai/filter/relative_link_filter.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/banzai/filter/relative_link_filter.rb b/lib/banzai/filter/relative_link_filter.rb
index 80c84c0f622..bf84d7cddae 100644
--- a/lib/banzai/filter/relative_link_filter.rb
+++ b/lib/banzai/filter/relative_link_filter.rb
@@ -102,7 +102,7 @@ module Banzai
end
def relative_file_path(uri)
- path = Addressable::URI.unescape(uri.path)
+ path = Addressable::URI.unescape(uri.path).delete("\0")
request_path = Addressable::URI.unescape(context[:requested_path])
nested_path = build_relative_path(path, request_path)
file_exists?(nested_path) ? nested_path : path