diff options
author | Marin Jankovski <marin@gitlab.com> | 2019-07-02 06:22:45 +0000 |
---|---|---|
committer | Marin Jankovski <marin@gitlab.com> | 2019-07-02 06:22:45 +0000 |
commit | 23dedd53a73a01429c0a5c99414548694f1fab0b (patch) | |
tree | 02bf23c4d0469afa63c8155e7fe386e2595f007a /lib/banzai | |
parent | 7eae0e9b529c5fb28b30857c06cd004dc5ebd74e (diff) | |
parent | ef5fdd3f3c7e46c9c051af094e5472fbe5f0af22 (diff) | |
download | gitlab-ce-23dedd53a73a01429c0a5c99414548694f1fab0b.tar.gz |
Merge branch 'security-DOS_issue_comments_banzai' into 'master'
Fix DOS when rendering issue/MR comments
See merge request gitlab/gitlabhq!3152
Diffstat (limited to 'lib/banzai')
-rw-r--r-- | lib/banzai/filter/relative_link_filter.rb | 2 |
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 |