Litestar has potential log injection in exception logging
Summary
Litestar does not escape url paths when logging exceptions. This makes logger vulnerable to CRLF injection if logging level is configured to debug or log_exceptions is set to "always", which allows attackers to inject newlines and forge log entries.
Details
Litestar directly formats unquoted path into exception logs without validation or escaping when using default exception logging handler.
Attackers can inject newlines in logs by embedding%0d%0a in url path.
log_exceptions="always" is not enabled by default. However, it is set in the examples of documentation (https://github.com/litestar-org/litestar/blob/1e0dc7c4d67151c836208a3e360051e983b5083a/docs/usage/logging.rst#logging). User will be impacted if they directly copy the logging config from docs.
PoC
curl "http://172.17.0.2:8000/%29%0D%0AINFO:%20%20%20%20%20127.0.0.1:8192%20-%20%22POST%20/login%20HTTP/1.1%22%20200%20OK%0D%0A%28"
logging:
2025-07-15 00:00:00 - litestar - ERROR - Uncaught exception (connection_type=http, path=/)
INFO: 127.0.0.1:8192 - "POST /login HTTP/1.1" 200 OK
...
If stacktracks for 404 are configured to be ignored (disable_stack_trace={404},), attacker may also exploit this by sending malformed requests to cause 400/500 exceptions and avoid 404 in endpoints with str path parameters.
Software afectado
Haz clic en una tecnología para ver todas sus vulnerabilidades.
| Plataforma | Paquete | Versiones vulnerables | Corregida en |
|---|---|---|---|
| Python (PyPI) | litestar | < 2.17.0 | 2.17.0 |
Referencias
- Vector CVSS
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N- Debilidad (CWE)
CWE-117- Plataforma
- Python (PyPI)
- Paquete
litestar- Publicada
- 11.08.2025
- Actualizado
- 11.10.2026 12:19
Fuentes y licencias
OSV / GitHub Advisory Database - GHSA-674p-xv2x-rf3g - CC BY 4.0
Historial de vulnerabilidades: litestar
Todas las vulnerabilidades publicadas de este paquete (Python (PyPI)), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.
- Entradas en total
- 9
- Primera → última
- 05.2024 06.2026
- Sin corrección
- 0
- Explotada en ataques
- 0
Distribución por gravedad
- Alta 5
- Media 3
- Baja 1
Divulgaciones por año
- 2024: 2
- 2025: 2
- 2026: 5
-
Litestar has potential log injection in exception logging esta entrada
Identifica las vulnerabilidades de tu aplicación
Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.