Skip to content

CVE-2026-77358 cpp-httplib: Use-after-free of TLS session in WebSocketClient::shutdown_and_close()

HighCVSS 8.2 EPSS 0.45%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
Proof of concept public · automatable: yes · technical impact: total
Technology
UbuntuDebian

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.

Upgrade path

8 packages: 0 fixed, 7 with no fix yet.

PackageAffectedFixed inStatus
debian/cpp-httplib(Debian 12) = 0.11.4+ds-1; = 0.11.4+ds-1+deb12u1; = 0.11.4+ds-2; = 0.11.4+ds-3 +24 more No fix listed No fix yet
debian/cpp-httplib(Debian 13) = 0.18.7-1; = 0.18.7-1+deb13u1; = 0.20.1+ds-3; = 0.25.0+ds-1 +6 more No fix listed No fix yet
debian/cpp-httplib(Debian 14) = 0.18.7-1; = 0.20.1+ds-3; = 0.25.0+ds-1; = 0.26.0+ds-2 +5 more No fix listed No fix yet
ubuntu/cpp-httplib(Ubuntu 22.04) All versions No fix listed No fix yet
ubuntu/cpp-httplib(Ubuntu 24.04) All versions No fix listed No fix yet
ubuntu/cpp-httplib(Ubuntu 26.04) All versions No fix listed No fix yet
ubuntu/cpp-httplib(Ubuntu 26.10) All versions No fix listed No fix yet
yhirose cpp-httplib = >= 0.33.0, < 0.50. No fix listed Versions listed

Affected products

ProductAffected versionsFixed in
yhirose cpp-httplib = >= 0.33.0, < 0.50. No fix listed
debian/cpp-httplib(Debian:12) All versions No fix listed
debian/cpp-httplib(Debian:12) = 0.11.4+ds-1 No fix listed
debian/cpp-httplib(Debian:12) = 0.11.4+ds-1+deb12u1 No fix listed
debian/cpp-httplib(Debian:12) = 0.11.4+ds-2 No fix listed
debian/cpp-httplib(Debian:12) = 0.11.4+ds-3 No fix listed
debian/cpp-httplib(Debian:12) = 0.13.1+ds-1 No fix listed
debian/cpp-httplib(Debian:12) = 0.14.0+ds-1 No fix listed
debian/cpp-httplib(Debian:12) = 0.14.1+ds-1 No fix listed
debian/cpp-httplib(Debian:12) = 0.14.1+ds-2 No fix listed
debian/cpp-httplib(Debian:12) = 0.14.2+ds-1 No fix listed
debian/cpp-httplib(Debian:12) = 0.14.3+ds-1 No fix listed
debian/cpp-httplib(Debian:12) = 0.14.3+ds-1.1 No fix listed
debian/cpp-httplib(Debian:12) = 0.14.3+ds-1.1~exp1 No fix listed
debian/cpp-httplib(Debian:12) = 0.15.3+ds-1 No fix listed
debian/cpp-httplib(Debian:12) = 0.15.3+ds-2 No fix listed
debian/cpp-httplib(Debian:12) = 0.15.3+ds-3 No fix listed
debian/cpp-httplib(Debian:12) = 0.16.0+ds-1 No fix listed
debian/cpp-httplib(Debian:12) = 0.16.3+ds-1 No fix listed
debian/cpp-httplib(Debian:12) = 0.16.3+ds-2 No fix listed
debian/cpp-httplib(Debian:12) = 0.18.0+ds-1 No fix listed
debian/cpp-httplib(Debian:12) = 0.18.7-1 No fix listed
debian/cpp-httplib(Debian:12) = 0.20.1+ds-3 No fix listed
debian/cpp-httplib(Debian:12) = 0.25.0+ds-1 No fix listed
debian/cpp-httplib(Debian:12) = 0.26.0+ds-2 No fix listed
Show 27 more
ProductAffected versionsFixed in
debian/cpp-httplib(Debian:12) = 0.41.0+ds-1 No fix listed
debian/cpp-httplib(Debian:12) = 0.41.0+ds-2 No fix listed
debian/cpp-httplib(Debian:12) = 0.41.0+ds-3 No fix listed
debian/cpp-httplib(Debian:12) = 0.41.0+ds-3~bpo13+1 No fix listed
debian/cpp-httplib(Debian:13) All versions No fix listed
debian/cpp-httplib(Debian:13) = 0.18.7-1 No fix listed
debian/cpp-httplib(Debian:13) = 0.18.7-1+deb13u1 No fix listed
debian/cpp-httplib(Debian:13) = 0.20.1+ds-3 No fix listed
debian/cpp-httplib(Debian:13) = 0.25.0+ds-1 No fix listed
debian/cpp-httplib(Debian:13) = 0.26.0+ds-2 No fix listed
debian/cpp-httplib(Debian:13) = 0.41.0+ds-1 No fix listed
debian/cpp-httplib(Debian:13) = 0.41.0+ds-2 No fix listed
debian/cpp-httplib(Debian:13) = 0.41.0+ds-3 No fix listed
debian/cpp-httplib(Debian:13) = 0.41.0+ds-3~bpo13+1 No fix listed
debian/cpp-httplib(Debian:14) All versions No fix listed
debian/cpp-httplib(Debian:14) = 0.18.7-1 No fix listed
debian/cpp-httplib(Debian:14) = 0.20.1+ds-3 No fix listed
debian/cpp-httplib(Debian:14) = 0.25.0+ds-1 No fix listed
debian/cpp-httplib(Debian:14) = 0.26.0+ds-2 No fix listed
debian/cpp-httplib(Debian:14) = 0.41.0+ds-1 No fix listed
debian/cpp-httplib(Debian:14) = 0.41.0+ds-2 No fix listed
debian/cpp-httplib(Debian:14) = 0.41.0+ds-3 No fix listed
debian/cpp-httplib(Debian:14) = 0.41.0+ds-3~bpo13+1 No fix listed
ubuntu/cpp-httplib(Ubuntu:22.04) All versions No fix listed
ubuntu/cpp-httplib(Ubuntu:24.04) All versions No fix listed
ubuntu/cpp-httplib(Ubuntu:26.04) All versions No fix listed
ubuntu/cpp-httplib(Ubuntu:26.10) All versions No fix listed

References