markdown2 malformed HTML tokenizer CPU denial of service
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Inizia in lib/markdown2.py, in _sorta_html_tokenize_re.split(), e riproduci il problema con bash ./poc/run.sh usando il proof of concept allegato. Ispeziona l’espressione regolare del ramo dei tag e verifica che i frammenti malformati non attivino più il timeout di un secondo, preservando al contempo il comportamento previsto della tokenizzazione HTML.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
python-markdown2 can spend unbounded CPU in its inline HTML tokenizer when rendering attacker-controlled Markdown containing repeated malformed tag fragments. At the pinned commit, the public markdown2.markdown() path can pass that text to _sorta_html_tokenize_re.split() in lib/markdown2.py, and a roughly 60 KB input deterministically reaches the local one-second timeout oracle. Applications that render untrusted Markdown synchronously can therefore have request workers tied up by a single document.
To Reproduce
INT-regex-markdown2-html-tokenizer-redos.zip
See attached file.
bash ./poc/run.sh
timed_out after 1s
Expected behavior
Tag-branch regex fails to match the malformed fragment in linear time.
Debug info
- Project: markdown2
- Repo: https://github.com/trentm/python-markdown2
- Pinned ref: 28d94df671eb2a149643310513f84bb00a084072
For more details, see README.md of attached file.
- Lingua principale
- Python
- Stelle
- 2.8k
- Fork
- 459
- Merge medio
- 2g 19h
- PR unite (30g)
- 4
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di trentm/python-markdown2
-
Add py.typed marker Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
trentm/python-markdown2#696 ·
-
More XSS's in safe mode Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
trentm/python-markdown2#726 ·
-
Bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
trentm/python-markdown2#688 · 4 commenti ·
-
Bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
trentm/python-markdown2#679 · 2 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
trentm/python-markdown2#635 · 2 commenti ·
Tutte le issue di trentm/python-markdown2
Issue simili
-
agent-ready documentation needs-triage
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
-
documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
instance instance add
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
searxng/searx-instances#939 · 1 commento ·
-
area-deployment area-integrations triage:bot-seen
Difficoltà 2/5 Mezza giornata Idoneità per principianti 86/100