diff options
author | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-10-26 09:06:59 +0300 |
---|---|---|
committer | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-11-25 08:17:31 +0300 |
commit | 54564e79d311f06cbf279d137d6d517efc5c9fb2 (patch) | |
tree | 55db552337ecc543c861d14ad5ec6397e31389c6 /lib/banzai | |
parent | 33c89fa9c7473f6eca7839697c8673d52087c42a (diff) |
Escape namespace in label references
When referencing cross-namespace labels, we append the namespace name
to the rendered label.
This MR escapes the name to prevent XSS attacks.
Diffstat (limited to 'lib/banzai')
-rw-r--r-- | lib/banzai/filter/label_reference_filter.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/banzai/filter/label_reference_filter.rb b/lib/banzai/filter/label_reference_filter.rb index db620c65237..609ea8fb5ca 100644 --- a/lib/banzai/filter/label_reference_filter.rb +++ b/lib/banzai/filter/label_reference_filter.rb @@ -89,7 +89,7 @@ module Banzai parent_from_ref = from_ref_cached(project_path) reference = parent_from_ref.to_human_reference(parent) - label_suffix = " <i>in #{reference}</i>" if reference.present? + label_suffix = " <i>in #{ERB::Util.html_escape(reference)}</i>" if reference.present? end presenter = object.present(issuable_subject: parent) |