Uh oh!
There was an error while loading. Please reload this page.
Make URL handling consistent between links and images - #1359
Conversation
UziTech
commented
Oct 18, 2018
I think we are trying to get rid of the |
Even if that's the eventual goal, this change will still increase consistency, make it easier to remove sanitization later (only one place to change the code), and make sure all other URL munging (like baseUrl resolution) stays consistent between links and images. |
@UziTech I agree we should get rid of the sanitize option. But I think @aprotim has some valid points here. The way I understand this PR, it makes sure both link urls and image urls are sanitized in the same way. I would think everyone would benefit from this change. It just might send the wrong message if the release notes show we are making changes to the sanitizer and the next release it gets removed. |
aprotim
commented
Oct 18, 2018
Is the rename of this PR sufficient to address that concern, @styfle? |
aprotim
commented
Oct 18, 2018
I'm not super familiar with the flow here, so just making sure there's nothing else I'm supposed to do before these PRs get merged? |
styfle
commented
Oct 19, 2018
| --- | ||
| sanitize: true | ||
| --- | ||
| [URL](javascript:alert) |
There was a problem hiding this comment.
These are links, not images. ! are missing
aprotim
commented
Oct 19, 2018
Whoops! I definitely thought I'd changed those. Maybe I accidentally blew away my changes while I was trying to figure out how to do the branching right. Fixed? |
Marked version:
b6d5a67
Markdown flavor: all
Description
Expectation
With sanitization on, I'd expect
[Link](javascript:alert('xss')))To result in
<p>LinkImage</p>Result
<p>Link <img src="javascript:alert('xss')" alt="Image"></p>What was attempted
marked("[Link](javascript:alert('xss'))\n)", {sanitize: true})Contributor
Committer
In most cases, this should be a different person than the contributor.