Skip to content

Commit bce17c5

Browse files
committed
Fix XSS on image link
1 parent 43f1c48 commit bce17c5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mistune/inline_parser.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def parse_std_link(self, m, state):
138138
title = ESCAPE_CHAR.sub(r'\1', title[1:-1])
139139

140140
if line[0] == '!':
141-
return 'image', link, text, title
141+
return 'image', escape_url(link), text, title
142142

143143
return self.tokenize_link(line, link, text, title, state)
144144

@@ -156,7 +156,7 @@ def parse_ref_link(self, m, state):
156156
title = ESCAPE_CHAR.sub(r'\1', title)
157157

158158
if line[0] == '!':
159-
return 'image', link, text, title
159+
return 'image', escape_url(link), text, title
160160

161161
return self.tokenize_link(line, link, text, title, state)
162162

0 commit comments

Comments
 (0)