5.3medium
cpp-httplib's default exception handler leaks e.what() to clients via EXCEPTION_WHAT response header
- Severity
- 5.3medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.34% (higher than 30% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
Description
cpp-httplib is a C++11 single-file header-only cross platform HTTP/HTTPS library. Prior to 0.35.0, when a request handler throws a C++ exception and the application has not registered a custom exception handler via set_exception_handler(), the library catches the exception and writes its message directly into the HTTP response as a header named EXCEPTION_WHAT. This header is sent to whoever made the request, with no authentication check and no special configuration required to trigger it. The behavior is on by default. A developer who does not know to opt in to set_exception_handler() will ship a server that leaks internal exception messages to any client. This vulnerability is fixed in 0.35.0.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| yhirose cpp-httplib | < 0.35.0, before 0.35.0 | CVE List, NVD |
Classification
SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.
What each source says
CVE List
cpp-httplib is a C++11 single-file header-only cross platform HTTP/HTTPS library. Prior to 0.35.0, when a request handler throws a C++ exception and the application has not registered a custom exception handler via set_exception_handler(), the library catches the exception and writes its message directly into the HTTP response as a header named EXCEPTION_WHAT. This header is sent to whoever made the request, with no authentication check and no special configuration required to trigger it. The behavior is on by default. A developer who does not know to opt in to set_exception_handler() will ship a server that leaks internal exception messages to any client. This vulnerability is fixed in 0.35.0.
NVD (es)
cpp-httplib es una librería HTTP/HTTPS multiplataforma de un solo archivo de solo encabezado C++11. Antes de la versión 0.35.0, cuando un gestor de solicitudes lanza una excepción de C++ y la aplicación no ha registrado un gestor de excepciones personalizado a través de set_exception_handler(), la librería captura la excepción y escribe su mensaje directamente en la respuesta HTTP como un encabezado llamado EXCEPTION_WHAT. Este encabezado se envía a quienquiera que haya realizado la solicitud, sin verificación de autenticación y sin necesidad de configuración especial para activarlo. El comportamiento está activado por defecto. Un desarrollador que no sabe cómo optar por set_exception_handler() distribuirá un servidor que filtra mensajes de excepción internos a cualquier cliente. Esta vulnerabilidad se corrige en la versión 0.35.0.
References
| https://github.com/yhirose/cpp-httplib/security/advisories/GHSA-8mpw-r4gc-xm7q | exploit, mitigation, vendor-advisory | |
| https://github.com/yhirose/cpp-httplib/commit/defd907c7469c5c8281247b73bbd07be24c31164 | patch | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-28434 changed 2026-03-04 | CVE Terms of Use |
| NVD | CVE-2026-28434 changed 2026-06-17 | Public domain |