Full Report
Sei is a popular L1 blockchain built on Cosmos that runs both EVM and CosmWasm runtimes. After a recent infinite mint and DoS, the authors decided to try to find more bugs in it. The function GetRawSignatureValues decodes a BlobTx submitted by the end user. When this data is being decoded, MustFromBig can underflow, resulting in a panic. This decoding of transactions happens within the FinalizeBlock code of the ABCI, which doesn't have panic handlers. So, this takes down all Sei nodes. The proof of concept is crazily simple - a transaction with z0000000000000000000000000000000000000000000000000 as the bytes. This will lead to S value of a signature underflowing and result in a crash. To fix the vulnerability, a recover() should be used to catch the panic. Particular parts of Cosmos don't handle panics in important code; this does the panic handling now. Good find!
Analysis Summary
# Vulnerability: Sei Blockchain Denial of Service via Transaction Decoding Panic
## CVE Details
- **CVE ID:** Not explicitly assigned in the provided text (Common for blockchain-specific findings until official disclosure).
- **CVSS Score:** 7.5 (High - Estimated based on total Availability loss).
- **CWE:** CWE-191: Integer Underflow (leading to panic/crash).
## Affected Systems
- **Products:** Sei Network (L1 Blockchain).
- **Versions:** Versions prior to the fix in the `FinalizeBlock` and `GetRawSignatureValues` logic.
- **Configurations:** Nodes running the dual EVM and CosmWasm runtimes utilizing the ABCI `FinalizeBlock` implementation.
## Vulnerability Description
The vulnerability exists within the `GetRawSignatureValues` function, which is responsible for decoding a `BlobTx` submitted by a user. During the decoding process, the system calls a function named `MustFromBig`. When processing specifically crafted malformed bytes, `MustFromBig` triggers an integer underflow, resulting in a Go **panic**.
Because this transaction decoding occurs within the `FinalizeBlock` phase of the Application BlockChain Interface (ABCI)—a critical section of code that lacks global panic handlers—the panic propagates upward and crashes the entire node process. Since all nodes on the network attempt to process the same block, a single malicious transaction can cause a network-wide Denial of Service (DoS).
## Exploitation
- **Status:** PoC available.
- **Complexity:** Low.
- **Attack Vector:** Network (Remote). A user simply needs to submit a malformed transaction to the network.
## Impact
- **Confidentiality:** None.
- **Integrity:** None.
- **Availability:** Total (Network-wide crash/halt of all Sei nodes).
## Remediation
### Patches
- The vulnerability is addressed by implementing `recover()` mechanisms within the ABCI code to catch panics during transaction decoding.
- Users and validators should update to the latest Sei node version released following this discovery.
### Workarounds
- No effective manual workaround exists for validators other than upgrading the node software, as the crash occurs during the consensus-critical `FinalizeBlock` stage.
## Detection
- **Indicators of Compromise:** Node logs showing a panic/stack trace originating from `GetRawSignatureValues` or `MustFromBig` during the `FinalizeBlock` execution.
- **PoC Payload:** A transaction containing the byte sequence: `z0000000000000000000000000000000000000000000000000`.
## References
- **Vendor:** Sei Network - hxxps[://]www[.]sei[.]io/
- **Research Source:** Details based on findings following a recent Sei infinite mint/DoS audit.