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

[shadow] Javascript injection #30

Closed
trentm opened this issue Mar 7, 2011 · 0 comments
Closed

[shadow] Javascript injection #30

trentm opened this issue Mar 7, 2011 · 0 comments

Comments

@trentm
Copy link
Owner

trentm commented Mar 7, 2011

_This is a _shadow issue* for Issue 30 on Google Code (from which this project was moved).
Added 2009-09-29T17:29:09.000Z by c2531...@tyldd.com. Closed (Fixed).
Labels: Type-Defect, Priority-Critical.
Please make updates to the bug there.*

Original description

Quotation marks are not filtered from attributes, you can inject javascript
events into elements. Here is an example:

from markdown2 import markdown
test = """
![a][b]
[b]: http://static.reddit.com/reddit.com.header.png"
onload="alert('javascript injected')
"""
print markdown(test, safe_mode=True)

The result is:
<p><img src=&quot;http://static.reddit.com/reddit.com.header.png&quot;
onload=&quot;alert('javascript injected')&quot; alt=&quot;a&quot; /></p>

Expected result is:
<p><img src=&quot;http://static.reddit.com/reddit.com.header.png&quot;
onload=&quot;alert('javascript injected')&quot; alt=&quot;a&quot; /></p>
This issue was closed.
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

No branches or pull requests

1 participant