Skip to content

Commit

Permalink
Delete gist embed rule to avoid XSS
Browse files Browse the repository at this point in the history
  • Loading branch information
getty104 committed Mar 19, 2021
1 parent 3fa3613 commit b5d4e60
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 33 deletions.
1 change: 0 additions & 1 deletion lib/qiita/markdown.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
require "qiita/markdown/embed/code_pen"
require "qiita/markdown/embed/tweet"
require "qiita/markdown/embed/asciinema"
require "qiita/markdown/embed/gist"
require "qiita/markdown/embed/youtube"
require "qiita/markdown/embed/slide_share"
require "qiita/markdown/embed/google_slide"
Expand Down
9 changes: 0 additions & 9 deletions lib/qiita/markdown/embed/gist.rb

This file was deleted.

1 change: 0 additions & 1 deletion lib/qiita/markdown/transformers/filter_script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class FilterScript

HOST_WHITE_LIST = [
Embed::Asciinema::SCRIPT_HOST,
Embed::Gist::SCRIPT_HOST,
].flatten.freeze

def self.call(*args)
Expand Down
22 changes: 0 additions & 22 deletions spec/qiita/markdown/processor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1451,28 +1451,6 @@
end
end

context "with HTML embed code for Gist" do
let(:markdown) do
<<-MARKDOWN.strip_heredoc
<script id="example" src="https://gist.github.com/a/example.js"></script>
MARKDOWN
end

if allowed
it "does not sanitize embed code" do
should eq <<-HTML.strip_heredoc
<script id="example" src="https://gist.github.com/a/example.js"></script>
HTML
end
else
it "forces async attribute on script" do
should eq <<-HTML.strip_heredoc
<script id="example" src="https://gist.github.com/a/example.js" async="async"></script>
HTML
end
end
end

context "with HTML embed code for Youtube" do
let(:markdown) do
<<-MARKDOWN.strip_heredoc
Expand Down

0 comments on commit b5d4e60

Please sign in to comment.