Skip to content

Commit

Permalink
Fix XSS on image link
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed Dec 30, 2021
1 parent 43f1c48 commit bce17c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mistune/inline_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def parse_std_link(self, m, state):
title = ESCAPE_CHAR.sub(r'\1', title[1:-1])

if line[0] == '!':
return 'image', link, text, title
return 'image', escape_url(link), text, title

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

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

if line[0] == '!':
return 'image', link, text, title
return 'image', escape_url(link), text, title

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

Expand Down

0 comments on commit bce17c5

Please sign in to comment.