Commit 06f424ef authored by GitLab Release Tools Bot's avatar GitLab Release Tools Bot

Merge branch 'security-fix-malicious-comment-master' into 'master'

Fix null byte error in upload path

Closes #148

See merge request gitlab-org/security/gitlab!571
parents f1467663 00f184e5
---
title: Fix null byte error in upload path
merge_request:
author:
type: security
......@@ -38,7 +38,7 @@ module Banzai
private
def unescape_and_scrub_uri(uri)
Addressable::URI.unescape(uri).scrub
Addressable::URI.unescape(uri).scrub.delete("\0")
end
end
end
......
......@@ -229,6 +229,7 @@ RSpec.describe Banzai::Filter::UploadLinkFilter do
'invalid UTF-8 byte sequences' | '%FF'
'garbled path' | 'open(/var/tmp/):%20/location%0Afrom:%20/test'
'whitespace' | "d18213acd3732630991986120e167e3d/Landscape_8.jpg\nand more"
'null byte' | "%00"
end
with_them do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment