{"id":"CVE-2026-77358","summary":"cpp-httplib: Use-after-free of TLS session in WebSocketClient::shutdown_and_close()","details":"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.","aliases":["GHSA-w7p7-f35j-mw7q"],"modified":"2026-08-29T03:47:16.451239832Z","published":"2026-08-27T22:37:14.339Z","database_specific":{"cna_assigner":"GitHub_M","cwe_ids":["CWE-416"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/77xxx/CVE-2026-77358.json"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/77xxx/CVE-2026-77358.json"},{"type":"ADVISORY","url":"https://github.com/yhirose/cpp-httplib/security/advisories/GHSA-w7p7-f35j-mw7q"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-77358"},{"type":"FIX","url":"https://github.com/yhirose/cpp-httplib/commit/2f986fd5e56e7c5f686d965174516360930f371d"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/yhirose/cpp-httplib","events":[{"introduced":"f1f8ff53d53096946a97416525a1079dd9e8a5b1"},{"fixed":"ed97a6edbabb096fc0a7fb2c63599475b94b81a8"}],"database_specific":{"extracted_events":[{"introduced":"0.33.0"},{"fixed":"0.50."}],"source":"AFFECTED_FIELD"}}],"versions":["v0.49.0","v0.48.0","v0.47.0","v0.46.1","v0.46.0","v0.45.1","v0.45.0","v0.44.0","v0.43.4","v0.43.3","v0.43.2","v0.43.1","v0.43.0","v0.42.0","v0.41.0","v0.40.0","v0.39.0","v0.38.0","v0.37.2","v0.37.1","v0.37.0","v0.35.0","v0.34.0","latest","v0.33.1","v0.33.0"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-77358.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V4","score":"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"}]}