Skip to content

Conversation

@Crozzers
Copy link
Contributor

This PR fixes #603.

The issue was with image URLs and code blocks. Putting a code block in the image URL (![](`code here`)) caused the URL to be hashed and protected from further modification. Code blocks are expected to contain URL unsafe characters like quotes so this is normal.

The problem was that in _protect_url, we attempt to escape any URL unsafe characters, but since the URL has been hashed it is ineffective.

This PR fixes this by completely unhashing the image URL before passing it to _protect_url, which allows special characters to be escaped

@nicholasserra
Copy link
Collaborator

LGTM thank you!

@nicholasserra nicholasserra merged commit ded5e74 into trentm:master Sep 23, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

XSS in escape safe mode

2 participants