Cookie Attribute Injection via Unescaped Semicolons in http.cookies.Morsel.OutputString()
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 18/100
Línea de trabajo
Start in Lib/http/cookies.py, at _has_control_character() and Morsel.OutputString(), to see how attribute values such as path, domain, samesite and version are validated and emitted. Then look at Lib/test/test_http_cookies.py for existing attribute tests. Done means semicolons in these values are rejected or quoted, with regression tests added. Pull request gh-161711 already targets this, so check it before starting.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug report
@ikow reported that http.cookies.Morsel.OutputString() does not quote or escape semicolons in cookie attribute values for path, domain, samesite, and version. The _has_control_character() validator (added in the CVE-2026-0672 fix) only checks C0 control characters ([\x00-\x1F\x7F]) and does not reject semicolons (0x3B), which are the Set-Cookie attribute delimiter per RFC 6265.
When an application reflects untrusted input into these cookie attributes, an attacker can inject arbitrary Set-Cookie attributes such as Domain, SameSite, Secure, and HttpOnly. Given the combination of how Morsel outputs cookies and how they're parsed, this opens up two possible attacks: SameSite policy downgrade and parent Domain expansion.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
- gh-161711
- gh-161893
- gh-161894
- gh-161901
- gh-161902
- gh-161903
- Lenguaje dominante
- Python
- Estrellas
- 78.2k
- Forks
- 36.6k
- Merge medio
- 19 h 57 min
- PR fusionados (30 d)
- 630
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de python/cpython
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
stdlib type-bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
extension-modules stdlib topic-XML type-bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
python/cpython#161807 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
stdlib type-feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
python/cpython#161788 · 7 comentarios ·
Los mantenedores suelen responder en 1 día
-
extension-modules topic-IO type-bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
Todos los issues de python/cpython
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
cpp-best-practices/project_validator#267 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Project-N-E-K-O/N.E.K.O#3725 ·
Los mantenedores suelen responder en 1 día
-
[Bug] Sending a Telegram message chain twice duplicates mentionsPosiblemente ocupada @123XieC la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
AstrBotDevs/AstrBot#11125 ·
Los mantenedores suelen responder en 1 día
-
backend bug priority: high
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
nooriegarg/ContribIQ#73 ·
Los mantenedores suelen responder en 1 día
-
bug p3 security
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
amd/gaia#8197 · 2 comentarios ·
Los mantenedores suelen responder en 1 día