Vulnerability · Published Aug 27, 2026 · Assigned by GitHub_M
CVE-2026-77358cpp-httplib: Use-after-free of TLS session in WebSocketClient::shutdown_and_close()
High 8.2
In plain English
A high-severity use-after-free in cpp-httplib from yhirose. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.4% (higher than 39% of all known vulnerabilities).
Official description
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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | cpp-httplib | no fix listed | DEBIAN-CVE-2026-77358 |
| Debian:13 | cpp-httplib | no fix listed | DEBIAN-CVE-2026-77358 |
| Debian:14 | cpp-httplib | no fix listed | DEBIAN-CVE-2026-77358 |
| Ubuntu:26.10 | cpp-httplib | no fix listed | UBUNTU-CVE-2026-77358 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| yhirose | cpp-httplib | >= 0.33.0, < 0.50. |
Weakness: CWE-416 · Vector: 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