Overview
Our goal in Blaize.Security is to secure blockchain ecosystems, working on all levels. Lately, we have finished the security audit for Kadcast – the networking protocol of Dusk blockchain. We worked with the Rust implementation of the Kadcast protocol, ensuring the integrity and stability of the protocol, its compliance with the original specification, and absence of the security vulnerabilities in the codebase.
Task
During our audit, we processed the Kadcast codebase via several streams of security reviews:
1) Review of the standard vulnerable areas, including but not limited to:
- Storage structure, stored data structure
- Public interfaces and restrictions
- Communication flow and interfaces between different modules
- Global settings of the protocol and local settings of each module, the default settings, and misconfiguration risks
- Modules co-dependencies and 3rd-party dependencies
- Denial-of-Service (DoS) attack surfaces
- Order-dependency and time-dependency of operations
- Validations of parameters of functions/methods/messages and return values
- Rust language-specific checks
and other potential vulnerabilities and attack vectors;
2) Protocol-specific checks – business logic decompositions to find loopholes, deadlocks, hidden backdoors, incorrect math and calculations, malicious code injections, and other flow-related issues;
This stage included the review of all main components of the protocol:
- data structures used for the Kadcast implementation
- messaging protocol and message structure, marshaling rules
- nodes processing (adding to the tree, refreshing, and eviction)
- review of the logic around the binary key generation and verification
- message broadcasting rules
And other key areas of the protocol
3) Comparison of the protocol to the original Kadcast specification against possible deviations
4) Several rounds of simulations and manual tests of the networking protocol with light clients; verification of compatibility with Dusk network node;
5) Our own internal security checklists, additionally verified during the testing stage.