go-panikint uncovers hidden integer overflow in Cosmos SDK RPC pagination
Turning silent integer overflows into panics enables fuzzers to discover previously hidden vulnerabilities, as demonstrated by finding an integer overflow in the Cosmos SDK.
Software Trail of Bits 31 Dec 2025 Tooling Real-world evidence
Published as “Detect Go’s silent arithmetic bugs with go-panikint”
Why it matters
Turning silent overflows into panics can expose hidden bugs in Go code, improving fuzzing effectiveness.
Summary
The team forked the Go compiler to inject runtime checks that panic on integer overflow or truncation. They ran fuzzing campaigns with the modified compiler and observed crashes when overflows occurred. Using this setup they discovered a live integer overflow in the Cosmos SDK's RPC pagination logic, where large offset+limit values caused an empty validator list. The evidence consists of a reproducible panic and a pull request to mitigate the issue, showing the approach works on real-world Go code.
What they found 1
- Discovered a live integer overflow in the Cosmos SDK RPC pagination logic
“we used it to find a live integer overflow in the Cosmos SDK’s RPC pagination logic”
Caveats 4
- The tool generated false positives for integer truncation during fuzzing, leading the authors to drop that feature
- Not all overflows are bugs; some are intentional, requiring filtering mechanisms
- We found that it generated false positives during our fuzzing campaigns. For this reason, we will not investigate further and will focus on arithmetic issues.
- However, not all overflows are bugs; some are intentional, especially in low-level code like the Go compiler itself
What’s new here 4
- Modified Go compiler that inserts runtime overflow checks and panics on violation
- Support for detecting integer truncation issues (though later disabled due to false positives)
- Filtering mechanisms (source-location whitelist and in-code comments) to ignore intentional overflows
- Discovery of a live integer overflow in Cosmos SDK RPC pagination using the tool