gitlab-org--gitlab-foss/lib/banzai/filter
Kerri Miller a76fdcb7a3 Reject slug+uri concat if slug is deemed unsafe
First reported:
  https://gitlab.com/gitlab-org/gitlab-ce/issues/60143

When the page slug is "javascript:" and we attempt to link to a relative
path (using `.` or `..`) the code will concatenate the slug and the uri.
This MR adds a guard to that concat step that will return `nil` if the
incoming slug matches against any of the "unsafe" slug regexes;
currently this is only for the slug "javascript:" but can be extended if
needed. Manually tested against a non-exhaustive list from OWASP of
common javascript XSS exploits that have to to with mangling the
"javascript:" method, and all are caught by this change or by existing
code that ingests the user-specified slug.
2019-05-24 12:33:24 -07:00
..
markdown_engines
wiki_link_filter Reject slug+uri concat if slug is deemed unsafe 2019-05-24 12:33:24 -07:00
absolute_link_filter.rb
abstract_reference_filter.rb Fix milestone references with HTML entities in the name 2019-05-24 10:07:21 +01:00
ascii_doc_post_processing_filter.rb
autolink_filter.rb Run rubocop -a on CE files 2019-05-05 03:24:28 -07:00
blockquote_fence_filter.rb Fenced blockquotes to not change source line pos 2019-04-04 18:59:31 -05:00
color_filter.rb
commit_range_reference_filter.rb
commit_reference_filter.rb
commit_trailers_filter.rb
emoji_filter.rb
epic_reference_filter.rb
external_issue_reference_filter.rb
external_link_filter.rb
footnote_filter.rb
front_matter_filter.rb Run rubocop -a on CE files 2019-05-05 03:24:28 -07:00
gollum_tags_filter.rb
html_entity_filter.rb
image_lazy_load_filter.rb
image_link_filter.rb
inline_diff_filter.rb
issuable_reference_filter.rb
issuable_state_filter.rb
issue_reference_filter.rb
label_reference_filter.rb Fix milestone references with HTML entities in the name 2019-05-24 10:07:21 +01:00
markdown_filter.rb
math_filter.rb
merge_request_reference_filter.rb Add merge request popover with details 2019-03-21 10:24:18 -04:00
mermaid_filter.rb
milestone_reference_filter.rb Fix milestone references with HTML entities in the name 2019-05-24 10:07:21 +01:00
output_safety.rb Implement multi-line suggestions filtering 2019-03-20 11:30:24 -03:00
plantuml_filter.rb
project_reference_filter.rb
redactor_filter.rb
reference_filter.rb Implement multi-line suggestions filtering 2019-03-20 11:30:24 -03:00
relative_link_filter.rb Update comments about N + 1 Gitaly calls 2019-04-09 17:21:16 +02:00
sanitization_filter.rb
set_direction_filter.rb
snippet_reference_filter.rb
spaced_link_filter.rb Run rubocop -a on CE files 2019-05-05 03:24:28 -07:00
suggestion_filter.rb Remove multi-line suggestions feature flag 2019-04-10 10:52:37 -03:00
syntax_highlight_filter.rb Implement multi-line suggestions filtering 2019-03-20 11:30:24 -03:00
table_of_contents_filter.rb Run rubocop -a on CE files 2019-05-05 03:24:28 -07:00
task_list_filter.rb
user_reference_filter.rb
video_link_filter.rb
wiki_link_filter.rb