Disable inline images

This commit is contained in:
Alex Gleason 2022-11-26 16:07:26 -06:00
parent 13c61e59e7
commit 6d4f99d9b3
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
3 changed files with 5 additions and 4 deletions

View file

@ -274,9 +274,7 @@
}
config :pleroma, :markup,
# XXX - unfortunately, inline images must be enabled by default right now, because
# of custom emoji. Issue #275 discusses defanging that somehow.
allow_inline_images: true,
allow_inline_images: false,
allow_headings: false,
allow_tables: false,
allow_fonts: false,

View file

@ -79,7 +79,6 @@ defmodule Pleroma.HTML.Scrubber.Default do
Meta.allow_tag_with_these_attributes(:img, [
"width",
"height",
"class",
"title",
"alt"
])

View file

@ -15,6 +15,8 @@ defmodule Pleroma.Web.ActivityPub.MRF.NormalizeMarkupTest do
this is a link with not allowed "rel" attribute: <a href="http://example.com/" rel="tag noallowed">example.com</a>
this is an image: <img src="http://example.com/image.jpg"><br />
<script>alert('hacked')</script>
<div class="wow no classes here">mean</div>
<img class="hehe" src="somewhere" />
"""
@expected """
@ -25,6 +27,8 @@ defmodule Pleroma.Web.ActivityPub.MRF.NormalizeMarkupTest do
this is a link with not allowed &quot;rel&quot; attribute: <a href="http://example.com/">example.com</a>
this is an image: <img src="http://example.com/image.jpg"/><br/>
alert(&#39;hacked&#39;)
mean
<img src="somewhere"/>
"""
test "it filter html tags" do