File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,9 @@ class ImageSyntax extends LinkSyntax {
24
24
}) {
25
25
final element = Element .empty ('img' );
26
26
final children = getChildren ();
27
- element.attributes['src' ] = destination;
27
+ element.attributes['src' ] = normalizeLinkDestination (
28
+ escapePunctuation (destination),
29
+ );
28
30
element.attributes['alt' ] = children.map ((node) {
29
31
// See https://spec.commonmark.org/0.30/#image-description.
30
32
// An image description may contain links. Fetch text from the alt
Original file line number Diff line number Diff line change 18
18
19
19
<<<
20
20
<p><img src="http://foo.com/foo.png" alt="alt" /></p>
21
+ >>> XSS
22
+ )
23
+
24
+ <<<
25
+ <p><img src="%22onerror=%22alert('XSS')" alt="Uh oh..." /></p>
You can’t perform that action at this time.
0 commit comments