CometBFT PeerState JSON serialization deadlock
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · Low
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub. Impact type from CWE-401.
Summary
CometBFT is a Byzantine Fault Tolerant (BFT) middleware that takes a state transition machine and replicates it on many machines. An internal modification made in versions 0.34.28 and 0.37.1 to the way struct `PeerState` is serialized to JSON introduced a deadlock when new function MarshallJSON is called. This function can be called from two places. The first is via logs, setting the `consensus` logging module to "debug" level (should not happen in production), and setting the log output format to JSON. The second is via RPC `dump_consensus_state`. Case 1, which should not be hit in production, will eventually hit the deadlock in most goroutines, effectively halting the node. In case 2, only the data structures related to the first peer will be deadlocked, together with the thread(s) dealing with the RPC request(s). This means that only one of the channels of communication to the node's peers will be blocked. Eventually the peer will timeout and excluded from the list (typically after 2 minutes). The goroutines involved in the deadlock will not be garbage collected, but they will not interfere with the system after the peer is excluded. The theoretical worst case for case 2, is a network with only two validator nodes. In this case, each of the nodes only has one `PeerState` struct. If `dump_consensus_state` is called in either node (or both), the chain will halt until the peer connections time out, after which the nodes will reconnect (with different `PeerState` structs) and the chain will progress again. Then, the same process can be repeated. As the number of nodes in a network increases, and thus, the number of peer struct each node maintains, the possibility of reproducing the perturbation visible with two nodes decreases. Only the first `PeerState` struct will deadlock, and not the others (RPC `dump_consensus_state` accesses them in a for loop, so the deadlock at the first iteration causes the rest of the iterations of that "for" loop to never be reached). This regression was fixed in versions 0.34.29 and 0.37.2. Some workarounds are available. For case 1 (hitting the deadlock via logs), either don't set the log output to "json", leave at "plain", or don't set the consensus logging module to "debug", leave it at "info" or higher. For case 2 (hitting the deadlock via RPC `dump_consensus_state`), do not expose `dump_consensus_state` RPC endpoint to the public internet (e.g., via rules in one's nginx setup).
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| cometbft | cometbft | = 0.34.28; = 0.37.1 | — | No fix listed | CNA |
| — | github.com/cometbft/cometbft (Go) | 0.34.28 to before 0.34.29 | 0.34.29 | Patch available | GHSA-mvj3-qrqh-cjvr |
| — | github.com/cometbft/cometbft (Go) | 0.37.1 to before 0.37.2 | 0.37.2 | Patch available | GHSA-mvj3-qrqh-cjvr |
- cometbft Vendorcometbft Affected = 0.34.28; = 0.37.1 Fixed in — No fix listed CNA
- github.com/cometbft/cometbft (Go) Vendor— Affected 0.34.28 to before 0.34.29 Fixed in 0.34.29 Patch available GHSA-mvj3-qrqh-cjvr
- github.com/cometbft/cometbft (Go) Vendor— Affected 0.37.1 to before 0.37.2 Fixed in 0.37.2 Patch available GHSA-mvj3-qrqh-cjvr
Remediation
- Fix · GHSA-mvj3-qrqh-cjvr github.com/cometbft/cometbft (Go) Fixed in 0.34.29 Advisory →
- Fix · GHSA-mvj3-qrqh-cjvr github.com/cometbft/cometbft (Go) Fixed in 0.37.2 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2023-34450
- 2026-10-03 Alias added: GHSA-mvj3-qrqh-cjvr
References
Exploit 2
More Cometbft vulnerabilities
- TI-2023-17277 CometBFT may duplicate transactions in the mempool's data structures CVSS 3.1HIGH 8.2
Sources
- CVE-2023-34450 · CVE Program
- CVE-2023-34450 · NVD
- FIRST EPSS
- GHSA-mvj3-qrqh-cjvr · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences