cpp-httplib
CVE-2026-77358
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconForce or await TLS WebSocket connection teardown (disconnect, reconnect, or scope exit)
-
Delivery`shutdown_and_close` frees SSL session object
-
Exploit`SSLSocketStream` retains dangling raw pointer to freed session
-
InstallWebSocket close frame transmitted through dangling pointer
-
C2OpenSSL reads and writes freed memory
-
ExecuteClient process memory corrupted
-
ImpactApplication crash (denial of service)
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Memory lifecycle management
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Privilege Escalation The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires that the consuming application uses cpp-httplib's TLS WebSocket client ( |
| Impact | The CVSS 4.0 score of 8.2 (AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H) correctly characterizes the primary risk: network-reachable, unauthenticated availability destruction against any application using TLS WebSocket connections. The AT:P qualifier (attack requirements present) acknowledges that wss:// usage must be in scope - plain HTTP and non-WebSocket HTTPS are unaffected. CVSS shows VC:N and VI:N, limiting the impact to availability; however, the intelligence feed tags include 'Information Disclosure,' which is not reflected in the vector - this discrepancy is unresolved and should be verified against the full GHSA advisory. EPSS data is absent from the provided intelligence, so exploitation probability cannot be quantified from that signal. KEV is not listed and no standalone POC exists beyond the regression tests shipped in 0.50.1, so the current signal is confirmed-vulnerability-with-patch rather than active exploitation. The most operationally significant risk factor is the header-only, statically compiled nature of the library: vulnerable versions are baked into consuming application binaries and will persist in deployed artifacts until each application is recompiled against 0.50.1, creating a supply-chain lag that extends the effective exposure window beyond the patch release date. |
| Exploit ScenarioDerived | A network server that deliberately drops or cycles a wss:// connection against a client application using cpp-httplib 0.33.0-0.50.0 can cause the client to trigger the use-after-free automatically during reconnection or teardown, crashing the client process. No crafted payload or authentication bypass is needed - the |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 27, 2026
Use-after-free in cpp-httplib's TLS WebSocket client (versions 0.33.0 through 0.50.0) corrupts process memory during ordinary secure WebSocket teardown, causing denial of service in any application that embeds this header-only C++ library with wss:// connections. The SSL/TLS session object is freed in WebSocketClient::shutdown_and_close before the WebSocket close frame is transmitted, but the underlying SSLSocketStream retains a raw pointer to the freed session and dereferences it during the close handshake. The defect is reachable through three distinct paths - the client destructor, an explicit shutdown_and_close call, and the connect() reconnect path - meaning routine connection lifecycle events, not crafted adversarial input, reliably trigger the corruption. No KEV listing or standalone public exploit exists at time of analysis; vendor-released patch version 0.50.1 is available.
RemediationAI
The primary fix is to upgrade cpp-httplib to version 0.50.1, which reorders the teardown sequence in WebSocketClient so the WebSocket close frame is dispatched while the TLS session is still live, then frees both objects in the correct order. Because cpp-httplib is a single-header library, upgrading requires replacing httplib.h in the consuming project and recompiling; no dynamic library update is sufficient. The fix commit is verifiable at https://github.com/yhirose/cpp-httplib/commit/2f986fd5e56e7c5f686d965174516360930f371d and the advisory is at https://github.com/yhirose/cpp-httplib/security/advisories/GHSA-w7p7-f35j-mw7q. If an immediate recompile is not feasible, the defect can be avoided by always calling client.close() explicitly on every WebSocketClient instance before it goes out of scope or before any subsequent connect() call - this bypasses the vulnerable shutdown_and_close code path. This workaround is fragile across exception paths and early returns, so it must be applied at every exit point, including exception handlers; it should be treated as a temporary bridge to the patch only.
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
cpp-httplib (CPE: cpe:2.3:a:yhirose:cpp-httplib:*:*:*:*:*:*:*:*) is a single-header C++ library providing HTTP/1.1, HTTP/2, and WebSocket client/server functionality with optional TLS support via OpenSSL. CWE-416 (Use After Free) is the root cause class: WebSocketClient::shutdown_and_close calls OpenSSL's session-free routine and nullifies its own pointer, but the WebSocket object holds a separate SSLSocketStream that retains an independent raw pointer to the same, now-freed, SSL structure. When the WebSocket subsequently attempts to send the RFC 6455 close frame, it reads and writes through this dangling pointer into freed memory. Because C++ destructor ordering is deterministic - the destructor calls shutdown_and_close - and because calling connect() on an open client also invokes shutdown_and_close on the existing connection before establishing the new one, the bug is not limited to an unusual teardown API: it manifests on every natural connection lifecycle event involving a still-open TLS WebSocket. The fix (commit 2f986fd) reorders operations so ws_->close() and ws_.reset() execute while the TLS session pointer is still valid, then frees the session afterward.
Know when Cpp Httplib gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Teardown path is network-reachable with no authentication; only availability is impacted as the dangling TLS pointer causes a crash, not data exposure.
AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
DescriptionCVE.org
cpp-httplib is a C++ header-only HTTP/HTTPS library. In versions 0.33.0 through 0.50.0, the TLS-enabled WebSocket client frees the TLS session before closing the WebSocket that still uses it, producing a use-after-free. In WebSocketClient::shutdown_and_close the SSL object is freed and the pointer cleared, but the subsequent WebSocket close still sends a close frame through the SSL socket stream, which holds a raw copy of the now-dangling session pointer and reads from and writes to the freed memory. The same freed-then-used ordering is reachable through the client's destructor and its connect path, so ordinary teardown of a secure WebSocket connection triggers the defect. This issue is fixed in version 0.50.1.
Executive ViewAI
Applications embedding cpp-httplib versions 0.33.0-0.50.0 face service-level denial-of-service risk from a use-after-free vulnerability triggered during routine WebSocket connection lifecycle events, with no public exploit identified at time of analysis. The vulnerability affects any service built on these library versions and will cause process crashes during normal connection teardown. Patch 0.50.1 is available and must be deployed across all affected applications to restore stability.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Use-after-free vulnerabilities occur when a program continues to access memory through a pointer after that memory has been deallocated.
Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Affected Products (CPE)CVE.org
More in Cpp Httplib
View allcpp-httplib is a C++11 single-file header-only cross platform HTTP/HTTPS library. Prior to 0.27.0, a vulnerability allow
CVE-2025-53628 is a memory exhaustion vulnerability in cpp-httplib versions prior to 0.20.1 that allows unauthenticated
cpp-httplib is a C++ header-only HTTP/HTTPS server and client library. Rated high severity (CVSS 7.5), this vulnerabilit
cpp-httplib is a C++11 single-file header-only cross platform HTTP/HTTPS library. In version 0.21.0, when many http head
CVE-2025-53629 is a Denial of Service vulnerability in cpp-httplib versions prior to 0.23.0 that allows unauthenticated
cpp-httplib versions prior to 0.30.1 are vulnerable to denial of service attacks due to insufficient validation of decom
cpp-httplib is a C++11 single-file header-only cross platform HTTP/HTTPS library. [CVSS 7.5 HIGH]
Cpp-Httplib versions up to 0.30.0 contains a vulnerability that allows attackers to add extra headers, modify request bo
cpp-httplib through 0.5.8 does not filter \r\n in parameters passed into the set_redirect and set_header functions, whic
HTTP response/header injection in cpp-httplib server versions prior to 0.44.0 allows remote unauthenticated attackers to
Remote denial of service in cpp-httplib prior to version 0.37.0 allows unauthenticated attackers to crash server process
A security vulnerability in cpp-httplib (CVSS 5.3) that allows attacker-controlled http headers. Risk factors: public Po
Same weakness CWE-416 – Use After Free
View allSame technique Information Disclosure
View allVendor StatusVendor
SUSE
Severity: Moderate| Product | Status |
|---|---|
| SUSE Linux Enterprise Desktop 15 SP7 | Not-Affected |
| SUSE Linux Enterprise Module for Development Tools 15 SP7 | Not-Affected |
| SUSE Linux Enterprise Server 15 SP7 | Not-Affected |
| SUSE Linux Enterprise Server 16.0 | Not-Affected |
| SUSE Linux Enterprise Server 16.0 | Not-Affected |
| SUSE Linux Enterprise Server 16.1 | Not-Affected |
| SUSE Linux Enterprise Server 16.1 | Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP7 | Not-Affected |
| SUSE Linux Enterprise Server for SAP applications 16.0 | Not-Affected |
| SUSE Linux Enterprise Server for SAP applications 16.0 | Not-Affected |
| SUSE Linux Enterprise Server for SAP applications 16.1 | Not-Affected |
| SUSE Linux Enterprise Server for SAP applications 16.1 | Affected |
| openSUSE Leap 16.0 | Not-Affected |
| openSUSE Leap 16.0 | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4-LTSS | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5 | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5-LTSS | Not-Affected |
| SUSE Linux Enterprise Module for Development Tools 15 SP4 | Not-Affected |
| SUSE Linux Enterprise Module for Development Tools 15 SP5 | Not-Affected |
| SUSE Linux Enterprise Module for Development Tools 15 SP6 | Not-Affected |
| SUSE Linux Enterprise Server 15 SP4 | Not-Affected |
| SUSE Linux Enterprise Server 15 SP4-LTSS | Not-Affected |
| SUSE Linux Enterprise Server 15 SP5 | Not-Affected |
| SUSE Linux Enterprise Server 15 SP5-LTSS | Not-Affected |
| SUSE Linux Enterprise Server 15 SP6 | Not-Affected |
| SUSE Linux Enterprise Server 15 SP6-LTSS | Not-Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP4 | Not-Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP5 | Not-Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP6 | Not-Affected |
| SUSE CaaS Platform 4.0 | Not-Affected |
| SUSE Enterprise Storage 6 | Not-Affected |
| SUSE Enterprise Storage 7 | Not-Affected |
| SUSE Enterprise Storage 7.1 | Not-Affected |
| SUSE Linux Enterprise Desktop 15 | Not-Affected |
| SUSE Linux Enterprise Desktop 15 SP1 | Not-Affected |
| SUSE Linux Enterprise Desktop 15 SP2 | Not-Affected |
| SUSE Linux Enterprise Desktop 15 SP3 | Not-Affected |
| SUSE Linux Enterprise Desktop 15 SP4 | Not-Affected |
| SUSE Linux Enterprise Desktop 15 SP5 | Not-Affected |
| SUSE Linux Enterprise Desktop 15 SP6 | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP1 | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP1-ESPOS | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP1-LTSS | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP2 | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP2-ESPOS | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP2-LTSS | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP3 | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP3-ESPOS | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP3-LTSS | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4 | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP4-ESPOS | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15 SP5-ESPOS | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15-ESPOS | Not-Affected |
| SUSE Linux Enterprise High Performance Computing 15-LTSS | Not-Affected |
| SUSE Linux Enterprise Module for Development Tools 15 | Not-Affected |
| SUSE Linux Enterprise Module for Development Tools 15 SP1 | Not-Affected |
| SUSE Linux Enterprise Module for Development Tools 15 SP2 | Not-Affected |
| SUSE Linux Enterprise Module for Development Tools 15 SP3 | Not-Affected |
| SUSE Linux Enterprise Real Time 15 SP2 | Not-Affected |
| SUSE Linux Enterprise Real Time 15 SP3 | Not-Affected |
| SUSE Linux Enterprise Real Time 15 SP4 | Not-Affected |
| SUSE Linux Enterprise Server 15 | Not-Affected |
| SUSE Linux Enterprise Server 15 SP1 | Not-Affected |
| SUSE Linux Enterprise Server 15 SP1-BCL | Not-Affected |
| SUSE Linux Enterprise Server 15 SP1-LTSS | Not-Affected |
| SUSE Linux Enterprise Server 15 SP2 | Not-Affected |
| SUSE Linux Enterprise Server 15 SP2-BCL | Not-Affected |
| SUSE Linux Enterprise Server 15 SP2-LTSS | Not-Affected |
| SUSE Linux Enterprise Server 15 SP3 | Not-Affected |
| SUSE Linux Enterprise Server 15 SP3-BCL | Not-Affected |
| SUSE Linux Enterprise Server 15 SP3-LTSS | Not-Affected |
| SUSE Linux Enterprise Server 15-LTSS | Not-Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 | Not-Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP1 | Not-Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP2 | Not-Affected |
| SUSE Linux Enterprise Server for SAP Applications 15 SP3 | Not-Affected |
| SUSE Manager Proxy 4.0 | Not-Affected |
| SUSE Manager Proxy 4.1 | Not-Affected |
| SUSE Manager Proxy 4.2 | Not-Affected |
| SUSE Manager Proxy 4.3 | Not-Affected |
| SUSE Manager Retail Branch Server 4.0 | Not-Affected |
| SUSE Manager Retail Branch Server 4.1 | Not-Affected |
| SUSE Manager Retail Branch Server 4.2 | Not-Affected |
| SUSE Manager Retail Branch Server 4.3 | Not-Affected |
| SUSE Manager Server 4.0 | Not-Affected |
| SUSE Manager Server 4.1 | Not-Affected |
| SUSE Manager Server 4.2 | Not-Affected |
| SUSE Manager Server 4.3 | Not-Affected |
| openSUSE Leap 15.3 | Not-Affected |
| openSUSE Leap 15.4 | Not-Affected |
| openSUSE Leap 15.5 | Not-Affected |
| openSUSE Leap 15.6 | Not-Affected |
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB