cpp-httplib — security advisory
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.
- Products
- cpp-httplib
- Affected versions
- 0.10.1+ds-1, 0.10.2+ds-1, 0.10.3+ds-1, 0.10.3+ds-1ubuntu0.1~esm1, 0.10.3+ds-1ubuntu0.1~esm2, 0.13.1+ds-1ubuntu1, 0.14.3+ds-1, 0.14.3+ds-1.1, 0.14.3+ds-1.1build1, 0.14.3+ds-1.1build2, 0.14.3+ds-1.1ubuntu0.1~esm1, 0.14.3+ds-1.1ubuntu0.1~esm2, 0.18.7-1, 0.26.0+ds-2ubuntu2, 0.26.0+ds-2ubuntu3, 0.26.0+ds-2ubuntu3+esm1, 0.26.0+ds-2ubuntu4, 0.9.10+ds-1, 0.9.9+ds-1
- Fixed versions
- Not specified
- CVEs
- CVE-2026-77358
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 03:19 UTC · Revision 1
Source evidence
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.
osv:UBUNTU-CVE-2026-77358
cpp-httplib
Fixed versions: Not specified
cpp-httplib
Fixed versions: Not specified
cpp-httplib
Fixed versions: Not specified
cpp-httplib
Fixed versions: Not specified
Complete source record
{
"id": "a2f3362f5388eb7736ae9164ac3dfcfaff461990c1fe8ef102242a329ce1763d",
"url": "https://osv.dev/vulnerability/UBUNTU-CVE-2026-77358",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "UBUNTU-CVE-2026-77358",
"summary": "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.",
"evidence": "osv:UBUNTU-CVE-2026-77358",
"products": [
{
"name": {
"value": "cpp-httplib",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "0.9.9+ds-1",
"evidence": "/affected/0/versions"
},
{
"value": "0.9.10+ds-1",
"evidence": "/affected/0/versions"
},
{
"value": "0.10.1+ds-1",
"evidence": "/affected/0/versions"
},
{
"value": "0.10.2+ds-1",
"evidence": "/affected/0/versions"
},
{
"value": "0.10.3+ds-1",
"evidence": "/affected/0/versions"
},
{
"value": "0.10.3+ds-1ubuntu0.1~esm1",
"evidence": "/affected/0/versions"
},
{
"value": "0.10.3+ds-1ubuntu0.1~esm2",
"evidence": "/affected/0/versions"
}
]
},
{
"name": {
"value": "cpp-httplib",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "0.13.1+ds-1ubuntu1",
"evidence": "/affected/1/versions"
},
{
"value": "0.14.3+ds-1",
"evidence": "/affected/1/versions"
},
{
"value": "0.14.3+ds-1.1",
"evidence": "/affected/1/versions"
},
{
"value": "0.14.3+ds-1.1build1",
"evidence": "/affected/1/versions"
},
{
"value": "0.14.3+ds-1.1build2",
"evidence": "/affected/1/versions"
},
{
"value": "0.14.3+ds-1.1ubuntu0.1~esm1",
"evidence": "/affected/1/versions"
},
{
"value": "0.14.3+ds-1.1ubuntu0.1~esm2",
"evidence": "/affected/1/versions"
}
]
},
{
"name": {
"value": "cpp-httplib",
"evidence": "/affected/2/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "0.26.0+ds-2ubuntu3",
"evidence": "/affected/2/versions"
},
{
"value": "0.26.0+ds-2ubuntu4",
"evidence": "/affected/2/versions"
}
]
},
{
"name": {
"value": "cpp-httplib",
"evidence": "/affected/3/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "0.18.7-1",
"evidence": "/affected/3/versions"
},
{
"value": "0.26.0+ds-2ubuntu2",
"evidence": "/affected/3/versions"
},
{
"value": "0.26.0+ds-2ubuntu3",
"evidence": "/affected/3/versions"
},
{
"value": "0.26.0+ds-2ubuntu3+esm1",
"evidence": "/affected/3/versions"
}
]
}
],
"severity": "high",
"structured": {
"id": "UBUNTU-CVE-2026-77358",
"aliases": [
"UBUNTU-CVE-2026-77358"
],
"metrics": [
{
"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"
},
{
"type": "Ubuntu",
"score": "medium"
}
],
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "cpp-httplib",
"purl": "pkg:deb/ubuntu/cpp-httplib?arch=source&distro=esm-apps%2Fjammy",
"ecosystem": "Ubuntu:Pro:22.04:LTS"
},
"versions": [
"0.9.9+ds-1",
"0.9.10+ds-1",
"0.10.1+ds-1",
"0.10.2+ds-1",
"0.10.3+ds-1",
"0.10.3+ds-1ubuntu0.1~esm1",
"0.10.3+ds-1ubuntu0.1~esm2"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-77358.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "libcpp-httplib0",
"binary_version": "0.10.3+ds-1ubuntu0.1~esm2"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "cpp-httplib",
"purl": "pkg:deb/ubuntu/cpp-httplib?arch=source&distro=esm-apps%2Fnoble",
"ecosystem": "Ubuntu:Pro:24.04:LTS"
},
"versions": [
"0.13.1+ds-1ubuntu1",
"0.14.3+ds-1",
"0.14.3+ds-1.1",
"0.14.3+ds-1.1build1",
"0.14.3+ds-1.1build2",
"0.14.3+ds-1.1ubuntu0.1~esm1",
"0.14.3+ds-1.1ubuntu0.1~esm2"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-77358.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "libcpp-httplib0.14t64",
"binary_version": "0.14.3+ds-1.1ubuntu0.1~esm2"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "cpp-httplib",
"purl": "pkg:deb/ubuntu/cpp-httplib?arch=source&distro=stonking",
"ecosystem": "Ubuntu:26.10"
},
"versions": [
"0.26.0+ds-2ubuntu3",
"0.26.0+ds-2ubuntu4"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-77358.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "libcpp-httplib0.26",
"binary_version": "0.26.0+ds-2ubuntu4"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "cpp-httplib",
"purl": "pkg:deb/ubuntu/cpp-httplib?arch=source&distro=esm-apps%2Fresolute",
"ecosystem": "Ubuntu:Pro:26.04:LTS"
},
"versions": [
"0.18.7-1",
"0.26.0+ds-2ubuntu2",
"0.26.0+ds-2ubuntu3",
"0.26.0+ds-2ubuntu3+esm1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-77358.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "libcpp-httplib0.26",
"binary_version": "0.26.0+ds-2ubuntu3+esm1"
}
]
}
}
],
"modified": "2026-10-17T13:01:07.851242647Z",
"provider": "osv",
"upstream": [
"CVE-2026-77358"
],
"references": [
"https://ubuntu.com/security/CVE-2026-77358",
"https://www.cve.org/CVERecord?id=CVE-2026-77358",
"https://github.com/yhirose/cpp-httplib/security/advisories/GHSA-w7p7-f35j-mw7q",
"https://github.com/yhirose/cpp-httplib/commit/2f986fd5e56e7c5f686d965174516360930f371d"
]
},
"related_cves": [
{
"value": "CVE-2026-77358",
"evidence": "/upstream"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 361040,
"published_at": "2026-08-28T00:18:00+00:00"
}