axone-protocol / axoned

⛓️ Axone blockchain 💫
https://axone.xyz
Apache License 2.0
164 stars 128 forks source link

🛡️ Barberry issue unresolved due to faulty upstream #621

Closed ccamel closed 6 months ago

ccamel commented 6 months ago

[!NOTE] Severity: Medium target: v7.1.0 - Commit: 3c854270b006db30aa3894da2cdba10cc31b8c5f Ref: OKP4 Blockchain Audit Report v1.0 - 02-05-2024 - BlockApex

Description

During the audit of the Okp4d blockchain, a critical observation was made concerning the blockchain's use of a customized implementation of the cosmos-sdk’s vesting module. The go.mod file in the okp4d repository is configured to link to okp4d/x/vesting rather than the standard cosmossdk/x/auth/vesting. This configuration oversight meant that while the CHANGELOG.md suggests updates to cosmos-sdk version 0.47.3 for critical patches (including a patch for the "Barberry" issue) and later to version 0.50.4, these updates were not fully integrated into the actual codebase.

The core of the issue lies not just in the module reference but in the approach to maintaining the custom module. When the "Barberry" issue was addressed in the cosmos-sdk, the necessary patches were not manually integrated into Okp4d's customvesting module. This misstep suggests a misunderstanding of how dependency management should align with the actual code enhancements made in the upstream cosmos-sdk. It's essential to note that while the patchwas intended to resolve a significant vulnerability, our testing on the okp4d's internal testnet using the exact attack scenario provided by the patch demonstrated that the vulnerability still persists, indicating an incomplete resolution.

Impact

The persistence of the "Barberry" vulnerability despite the reported updates has serious implications. By successfully executing the attack scenario provided, which ideally should have failed if the patch were effective, it was confirmed that the vulnerability remains exploitable. This situation exposes the network to potential security risks that could be leveraged by malicious actors to compromise the integrity of the blockchain. The effective management of such vulnerabilities is crucial for maintaining trust and security within the network infrastructure.

Recommandation

To rectify this oversight, it is crucial for the development team to implement a more robust process for integrating patches and updates. The Okp4d blockchain should not only pull updates from the cosmos-sdk but must also ensure that any custom modules, such as okp4d/x/vesting, are manually updated to reflect these changes.

References