{"id":"CVE-2026-77358","state":"PUBLISHED","title":"cpp-httplib: Use-after-free of TLS session in WebSocketClient::shutdown_and_close()","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.","publishedAt":"2026-08-27T22:37:14.339Z","updatedAt":"2026-08-31T18:25:37.895Z","severity":{"score":8.2,"label":"High","version":"4.0","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","source":"GitHub_M"},"assigner":"GitHub_M","products":["yhirose cpp-httplib"],"affected":[{"vendor":"yhirose","product":"cpp-httplib","versions":[{"version":">= 0.33.0, < 0.50.","status":"affected"}]}],"references":["https://github.com/yhirose/cpp-httplib/security/advisories/GHSA-w7p7-f35j-mw7q","https://github.com/yhirose/cpp-httplib/commit/2f986fd5e56e7c5f686d965174516360930f371d"],"weaknesses":["CWE-416"],"ingestedAt":"2026-10-29T20:13:07.220Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/77xxx/CVE-2026-77358.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-77358","state":"PUBLISHED","datePublished":"2026-08-27T22:37:14.339Z","dateUpdated":"2026-08-31T18:25:37.895Z","assignerShortName":"GitHub_M","assignerOrgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateReserved":"2026-08-20T19:28:35.245Z"},"containers":{"cna":{"title":"cpp-httplib: Use-after-free of TLS session in WebSocketClient::shutdown_and_close()","descriptions":[{"lang":"en","value":"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":[{"vendor":"yhirose","product":"cpp-httplib","versions":[{"version":">= 0.33.0, < 0.50.","status":"affected"}]}],"references":[{"url":"https://github.com/yhirose/cpp-httplib/security/advisories/GHSA-w7p7-f35j-mw7q","name":"https://github.com/yhirose/cpp-httplib/security/advisories/GHSA-w7p7-f35j-mw7q","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/yhirose/cpp-httplib/commit/2f986fd5e56e7c5f686d965174516360930f371d","name":"https://github.com/yhirose/cpp-httplib/commit/2f986fd5e56e7c5f686d965174516360930f371d","tags":["x_refsource_MISC"]}],"metrics":[{"cvssV4_0":{"attackVector":"NETWORK","attackComplexity":"LOW","attackRequirements":"PRESENT","privilegesRequired":"NONE","userInteraction":"NONE","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"NONE","vulnAvailabilityImpact":"HIGH","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","subAvailabilityImpact":"NONE","baseScore":8.2,"baseSeverity":"HIGH","vectorString":"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","version":"4.0"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-416","lang":"en","description":"CWE-416: Use After Free","type":"CWE"}]}],"providerMetadata":{"shortName":"GitHub_M","orgId":"a0819718-46f1-4df5-94e2-005712e83aaa","dateUpdated":"2026-08-27T22:37:14.339Z"},"source":{"advisory":"GHSA-w7p7-f35j-mw7q","discovery":"UNKNOWN"}},"adp":[{"title":"CISA ADP Vulnrichment","references":[{"url":"https://github.com/yhirose/cpp-httplib/security/advisories/GHSA-w7p7-f35j-mw7q","tags":["exploit"]}],"metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-08-31T18:25:12.543647Z","id":"CVE-2026-77358","options":[{"Exploitation":"poc"},{"Automatable":"yes"},{"Technical Impact":"total"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-08-31T18:25:37.895Z"}}]}}}