pyexpat: CPython can be crashed through resetting `StartDoctypeDeclHandler` with pyexpat at the wrong time
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 1/5
- Tempo estimado
- Menos de uma hora
- Facilidade para iniciantes
- 25/100
Direção de pesquisa
The report provides a reproducer using xml.parsers.expat.ParserCreate and says Expat upstream pull request #1437 fixes the crash. Start by checking how CPython vendors or updates Expat and whether that upstream fix is already included. Done means the reproducer no longer crashes; the report says this is defense-in-depth, not a vulnerability.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Hello!
It has been brought to my attention that the Expat XML parser can be crashed via a segmentation fault by resetting member StartDoctypeDeclHandler at the wrong time, like this:
from xml.parsers.expat import ParserCreate
parser = ParserCreate()
def reset_start_doctype_handler():
parser.StartDoctypeDeclHandler = None
return True
parser.StartDoctypeDeclHandler = lambda *_: None
parser.NotStandaloneHandler = reset_start_doctype_handler
parser.Parse(b"<!DOCTYPE r SYSTEM \"s\"><r/>", True)
This affects all versions of Python with all versions of Expat up to 2.9.0 including. Expat upstream pull request https://github.com/libexpat/libexpat/pull/1437 fixes this issue for itself and CPython and the fix will be contained in the next release that may come out as early as next Monday. So updating to the next release will fix this for Python for free, I just wanted to let you know.
Credits for this finding go to Bartłomiej Dmitruk (@hackerman70000) of https://www.striga.ai/ .
Bartłomiej reported this as defense-in-depth to me and we both do not consider this a vulnerability. If you come to difference conclusions, please let me know.
Best, Sebastian
CC @StanFromIreland @picnixz
- Linguagem predominante
- Python
- Estrelas
- 77.7k
- Forks
- 38.3k
- Merge médio
- 13h 43min
- PRs com merge (30d)
- 704
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de python/cpython
-
topic-socket type-bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
python/cpython#160561 · 7 comentários ·
Mantenedores costumam responder em até 1 dia
-
tests topic-profiling type-bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
python/cpython#160334 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
`iso2022_jp_3` encodes U+9B1D but decodes the result as U+9B1CTalvez já em andamento @kinqsradio assumiu hoje. Abertaextension-modules type-bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
Mantenedores costumam responder em até 1 dia
-
Remove unused FVS_* macrosAbertainterpreter-core type-feature
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 78/100
python/cpython#160109 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
extension-modules type-bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
python/cpython#160001 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de python/cpython
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
scikit-learn-contrib/category_encoders#553 ·
Mantenedores costumam responder em até 1 dia
-
tests/strategies_test.py:174 goes uncovered on about 1 run in 100, failing the coverage ratchetAbertaflaky-watch
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
btclib-org/btclib#2839 ·
Mantenedores costumam responder em até 1 dia
-
BarrelList constructor drops false-valued iterable contentsTalvez já em andamento @Gambit-Checkmate assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 19 dias
-
[Performance]: Redundant object-storage pull when model and tokenizer share the same RunAI URIAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
vllm-project/vllm#63863 ·
Mantenedores costumam responder em até 1 dia