gitlab-org--gitlab-foss/lib/banzai/filter
Kerri Miller acc694ead6 Extract SanitizeNodeLink and apply to WikiLinkFilter
The SanitizationFilter was running before the WikiFilter. Since
WikiFilter can modify links, we could see links that _should_ be stopped
by SanatizationFilter being rendered on the page. I (kerrizor) had
previously addressed the bug in: 7bc971915b
However, an additional exploit was discovered after that was merged.
Working through the issue, we couldn't simply shuffle the order of
filters, due to some implicit assumptions about the order of filters, so
instead we've extracted the logic that sanitizes a Nokogiri-generated
Node object, and applied it to the WikiLinkFilter as well.

On moving filters around:
Once we start moving around filters, we get cascading failures; fix one,
another one crops up. Many of the existing filters in the WikiPipeline
chain seem to assume that other filters have already done their work,
and thus operate on a "transform anything that's left" basis;
WikiFilter, for instance, assumes any link it finds in the markdown
should be prepended with the wiki_base_path.. but if it does that, it
also turns `href="@user"` into `href="/path/to/wiki/@user"`, which the
UserReferenceFilter doesn't see as a user reference it needs to
transform into a user profile link. This is true for all the reference
filters in the WikiPipeline.
2019-07-26 13:41:11 +00:00
..
markdown_engines
wiki_link_filter Extract SanitizeNodeLink and apply to WikiLinkFilter 2019-07-26 13:41:11 +00: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
ascii_doc_sanitization_filter.rb Preserve footnote link ids 2019-07-17 08:40:50 +02:00
autolink_filter.rb Extract SanitizeNodeLink and apply to WikiLinkFilter 2019-07-26 13:41:11 +00:00
base_sanitization_filter.rb Extract SanitizeNodeLink and apply to WikiLinkFilter 2019-07-26 13:41:11 +00: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 Properly handle multiple refs to same footnote 2019-02-13 14:41:28 -06:00
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
inline_embeds_filter.rb Expose metrics element for FE consumption 2019-07-10 11:27:25 +00:00
inline_metrics_filter.rb Expose metrics element for FE consumption 2019-07-10 11:27:25 +00:00
inline_metrics_redactor_filter.rb Expose metrics element for FE consumption 2019-07-10 11:27:25 +00:00
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
reference_filter.rb Implement multi-line suggestions filtering 2019-03-20 11:30:24 -03:00
reference_redactor_filter.rb Rename Redactor classes to ReferenceRedactor 2019-07-16 20:19:08 +00:00
relative_link_filter.rb Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce 2019-07-03 11:55:56 +02:00
sanitization_filter.rb Prevent excessive sanitization of AsciiDoc ouptut 2019-07-12 09:35:50 +02:00
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 Enable AsciiDoc syntax highlighting (using Rouge) 2019-07-02 09:24:05 +02: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 Extract SanitizeNodeLink and apply to WikiLinkFilter 2019-07-26 13:41:11 +00:00