summaryrefslogtreecommitdiff
path: root/spec/lib/banzai
diff options
context:
space:
mode:
authorMarin Jankovski <marin@gitlab.com>2019-07-02 06:22:45 +0000
committerMarin Jankovski <marin@gitlab.com>2019-07-02 06:22:45 +0000
commit23dedd53a73a01429c0a5c99414548694f1fab0b (patch)
tree02bf23c4d0469afa63c8155e7fe386e2595f007a /spec/lib/banzai
parent7eae0e9b529c5fb28b30857c06cd004dc5ebd74e (diff)
parentef5fdd3f3c7e46c9c051af094e5472fbe5f0af22 (diff)
downloadgitlab-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 'spec/lib/banzai')
-rw-r--r--spec/lib/banzai/filter/relative_link_filter_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/lib/banzai/filter/relative_link_filter_spec.rb b/spec/lib/banzai/filter/relative_link_filter_spec.rb
index 8ff971114d6..a714fa50f5f 100644
--- a/spec/lib/banzai/filter/relative_link_filter_spec.rb
+++ b/spec/lib/banzai/filter/relative_link_filter_spec.rb
@@ -83,6 +83,11 @@ describe Banzai::Filter::RelativeLinkFilter do
expect { filter(act) }.not_to raise_error
end
+ it 'does not explode with an escaped null byte' do
+ act = link("/%00")
+ expect { filter(act) }.not_to raise_error
+ end
+
it 'does not raise an exception with a space in the path' do
act = link("/uploads/d18213acd3732630991986120e167e3d/Landscape_8.jpg \nBut here's some more unexpected text :smile:)")
expect { filter(act) }.not_to raise_error