trentm / trentm/python-markdown2
More XSS's in safe mode
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.8k
- Forks
- 459
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 4
Description
Describe the bug
After the patches of #722, I manually found a simple bypass of the HTML entity regex, and ran the fuzzer again to find another HTML corruption.
To Reproduce
- The browser decodes
:to:forming ajavascript:protocol URL (entities can be prefixed with any amount of0's).
[Click me](javascript:alert(origin))
<p><a href="javascript:alert(origin)">Click me</a></p>
- Weird combination of syntax again resulting in raw HTML being output:
<x><svg onload=alert(origin)
<p><x<img src="code><a
></code" alt="" />><svg onload=alert(origin)<img src="code><a
></code" alt="" /></p>
Expected behavior
Safe HTML is output. Maybe use a proper HTML entity decoder to solve the first.
Debug info
Version of library being used: https://github.com/trentm/python-markdown2/commit/ba92f30e9101f485bfd6b2a3178908ee4a82da9f (latest master at time of writing)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing safe mode handling for HTML entities and malformed link/image syntax; reproduce the two Markdown inputs in the issue against the referenced commit. Done means both cases render as safe HTML without executable protocols or raw event-handler markup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100