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

Published May 29, 2026
·
Updated

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::settrustedproxies() 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 getclientip(), 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 Software

2 affected components
github/yhirose/cpp-httplib<0.44.0
Yhirose Cpp-httplib<0.44.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade cpp-httplib to a version that resolves this vulnerability.

    Fixed in 0.44.0

Event History

May 29, 2026
CVE Published
via MITRE·07:18 PM
Data Sourced
via MITRE·07:18 PM
DescriptionWeakness
Data Sourced
via NVD·08:16 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-46527?

CVE-2026-46527 has a severity rating of high with a score of 8.7.

2

How do I fix CVE-2026-46527?

To fix CVE-2026-46527, update cpp-httplib to version 0.44.0 or later.

3

What causes CVE-2026-46527?

CVE-2026-46527 is caused by a malicious `X-Forwarded-For` header that triggers undefined behavior and a server crash when handling trusted proxies.

4

What are the consequences of CVE-2026-46527?

The consequences of CVE-2026-46527 can include server crashes and potential service disruptions.

5

Which software is affected by CVE-2026-46527?

CVE-2026-46527 affects the cpp-httplib library used for HTTP/HTTPS communications.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203