CVE-2026-46527
JSON

8.7high

cpp-httplib: Malicious `X-Forwarded-For` Under Trusted-Proxy Configuration Triggers Empty `vector::front()`, Leading to Undefined Behavior and Server Crash

Severity
8.7high CVSS:4.0 by GitHub_M
Exploit likelihood
0.33% (higher than 27% 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.44.0, When the server has called Server::set_trusted_proxies() with a non-empty trusted-proxy list, an attacker can send an HTTP request that includes an X-Forwarded-For header whose value parses to no valid IP segments. The code path then executes get_client_ip(), which calls front() on an empty std::vector—undefined behavior in C++. On typical implementations this manifests as abnormal process termination (denial of service). With Sanitizers enabled, you get an explicit runtime diagnostic. This vulnerability is fixed in 0.44.0.

Affected

Product or packageVersionsReported by
yhirose cpp-httplib< 0.44.0, before 0.44.0CVE List, NVD

All scores

GitHub_M8.7high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-476

SSVC (CISA-ADP): exploitation poc, automatable no, 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.44.0, When the server has called Server::set_trusted_proxies() with a non-empty trusted-proxy list, an attacker can send an HTTP request that includes an X-Forwarded-For header whose value parses to no valid IP segments. The code path then executes get_client_ip(), which calls front() on an empty std::vector—undefined behavior in C++. On typical implementations this manifests as abnormal process termination (denial of service). With Sanitizers enabled, you get an explicit runtime diagnostic. This vulnerability is fixed in 0.44.0.

NVD (es)

cpp-httplib es una biblioteca HTTP/HTTPS multiplataforma de un solo archivo de cabecera C++11. Antes de 0.44.0, cuando el servidor ha llamado a Server::set_trusted_proxies() con una lista de proxies de confianza no vacía, un atacante puede enviar una solicitud HTTP que incluye una cabecera X-Forwarded-For cuyo valor se analiza como ningún segmento IP válido. La ruta del código entonces ejecuta get_client_ip(), que llama a front() en un std::vector vacío -comportamiento indefinido en C++. En implementaciones típicas, esto se manifiesta como terminación anormal del proceso (denegación de servicio). Con los Sanitizers habilitados, se obtiene un diagnóstico explícito en tiempo de ejecución. Esta vulnerabilidad está corregida en 0.44.0.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-46527 changed 2026-06-01CVE Terms of Use
NVDCVE-2026-46527 changed 2026-07-22Public domain