{"id":"CVE-2026-40943","aliases":["CVE-2026-40943","GHSA-5gqc-qhrj-9xw8","GO-2026-5145"],"related":[],"kind":"vulnerability","state":"published","title":"Oxia: Server crash via race condition in session heartbeat handling","summary":"Oxia is a metadata store and coordination system. Prior to 0.16.2, a race condition between session heartbeat processing and session closure can cause the server to panic with send on closed channel. The heartbeat() method uses a blocking channel send while holding a mutex, and under specific timing with concurrent close() calls, this can lead to either a deadlock (channel buffer full) or a panic (send on closed channel after TOCTOU gap in KeepAlive). This vulnerability is fixed in 0.16.2.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Oxia is a metadata store and coordination system. Prior to 0.16.2, a race condition between session heartbeat processing and session closure can cause the server to panic with send on closed channel. The heartbeat() method uses a blocking channel send while holding a mutex, and under specific timing with concurrent close() calls, this can lead to either a deadlock (channel buffer full) or a panic (send on closed channel after TOCTOU gap in KeepAlive). This vulnerability is fixed in 0.16.2.","source":"cvelist"},{"lang":"en","text":"### Summary\nA race condition between session heartbeat processing and session closure can cause the server to panic with `send on closed channel`. The `heartbeat()` method uses a blocking channel send while holding a mutex, and under specific timing with concurrent `close()` calls, this can lead to either a deadlock (channel buffer full) or a panic (send on closed channel after TOCTOU gap in `KeepAlive`).\n\n### Impact\nA remote client can trigger a server crash by sending rapid `KeepAlive` requests while a session is expiring or being closed. This is a denial-of-service vulnerability that crashes the entire data server process.\n\nAll versions are affected.\n\n### Details\nIn `oxiad/dataserver/controller/lead/session.go`, the `heartbeat()` method performs a blocking `s.heartbeatCh <- true` send. If the channel buffer is full (size 1), this blocks while holding the session mutex, preventing `close()` from acquiring the lock to close the channel — a deadlock.\n\nAdditionally, in `session_manager.go`, `KeepAlive()` releases the session manager's read lock before calling `heartbeat()`, creating a TOCTOU window where the session can be removed and closed between the lookup and the heartbeat call.\n\n### Patches\nFixed by changing `heartbeat()` to use a non-blocking `select` with a `default` case, and by holding the session manager read lock through the entire `KeepAlive()` operation.\n\n### Workarounds\nNo workaround available.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Oxia affected by server crash via race condition in session heartbeat handling in github.com/oxia-db/oxia","format":"markdown","source":"go"}],"published":"2026-04-14T23:15:00.000Z","modified":"2026-06-25T18:56:16.518Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","rating":"HIGH"}],"cwes":["CWE-362"],"affected":[{"ranges":[{"version":"< 0.16.2","status":"affected"}],"vendor":"oxia-db","product":"oxia","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.16.2"}],"ecosystem":"Go","package":"github.com/oxia-db/oxia","purl":"pkg:golang/github.com/oxia-db/oxia","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.16.2"}],"ecosystem":"Go","package":"github.com/oxia-db/oxia","purl":"pkg:golang/github.com/oxia-db/oxia","source":"go"}],"references":[{"url":"https://github.com/oxia-db/oxia/security/advisories/GHSA-5gqc-qhrj-9xw8","tags":["advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40943","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/oxia-db/oxia","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-04-22T13:54:53.719Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-40943","url":"https://www.cve.org/CVERecord?id=CVE-2026-40943","licence":"CVE Terms of Use","modified":"2026-04-22T13:55:27.811Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-5gqc-qhrj-9xw8","url":"https://github.com/advisories/GHSA-5gqc-qhrj-9xw8","licence":"CC-BY-4.0","modified":"2026-06-25T18:56:16.518Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5145","url":"https://pkg.go.dev/vuln/GO-2026-5145","licence":"CC-BY-4.0","modified":"2026-06-25T18:45:26.451Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-40943","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40943","licence":"Public domain","modified":"2026-06-17T10:45:55.210Z"}],"updatedAt":"2026-11-25T22:59:19.199Z","epss":{"score":0.00209,"percentile":0.11768,"date":"2026-12-01T12:00:22.000Z"}}