Prepared by:
HALBORN
Last Updated Unknown date
Date of Engagement: October 15th, 2024 - December 13th, 2024
100% of all REPORTED Findings have been addressed
All findings
30
Critical
0
High
1
Medium
2
Low
3
Informational
24
Tangle Network engaged Halborn to perform a security assessment of their Rust codebase from Oct. 15, 2024, to Dec. 13, 2024. The assessment focused on the substrate code, precompiled code, and pallets listed in the provided GitHub repository and included relevant commit hashes. More details can be found in the Scope section of this report.
The Halborn team was allocated 8 weeks and 3 days for the engagement and assigned two full-time security engineers to assess the security of the substrate pallets and the overall codebase. The security engineers are experts in blockchain and smart contract security, with advanced skills in penetration testing and smart contract auditing, as well as extensive knowledge of various blockchain protocols.
The purpose of this assessment is to:
Ensure that the codebase functions operate as intended, including properly implementing staking, pooling, reward mechanisms, and Ethereum compatibility features.
Identify potential security issues within the codebase, such as:
Cryptographic vulnerabilities (e.g., signature malleability, replay attacks, or misuse of hashing functions).
Logical inconsistencies in key functionalities like staking, unbonding, reward calculations.
Dependency-related risks from external crates and libraries.
Insufficient input validation or unchecked operations may lead to panics, overflows, or security exploits.
Verify that the code adheres to best practices for blockchain security, such as preventing unauthorized access, maintaining data integrity, and ensuring predictable execution under edge cases and adverse conditions.
Assess the implementation of Ethereum precompiles, proxy types, and EVM integration to ensure proper validation, safe asset handling, and gas usage efficiency.
The Halborn team performed a combination of manual code review and automated security testing to ensure a comprehensive and efficient assessment of the Tangle codebase. This approach balanced efficiency, timeliness, practicality, and accuracy to address the assessment scope. Manual testing was used to uncover flaws in logic, process, and implementation, while automated tools were employed to quickly identify deviations from security best practices. The following phases and associated tools were used throughout the assessment:
Research on the architecture, purpose, and usage of the Tangle network.
Manual code walkthroughs to understand the design of key modules, including staking, pooling, reward distribution, and EVM precompiles, while identifying potential vulnerabilities.
Assessment of Rust functions and variables for arithmetic vulnerabilities, such as overflow/underflow or unsafe computations.
Audit of cryptographic protocols and primitives, including ECDSA signature recovery and Ethereum address mapping, to ensure compliance with industry standards and robustness against attacks.
Scanning Rust crates with Cargo Audit to identify outdated dependencies, known vulnerabilities, and insecure versions of third-party libraries.
Analyzing unsafe code usage with Cargo Geiger, ensuring minimal reliance on unsafe Rust features to reduce risks of memory safety vulnerabilities.
Validation of error handling and logging practices to prevent unintentional exposure of sensitive information or system behavior.
| EXPLOITABILITY METRIC () | METRIC VALUE | NUMERICAL VALUE |
|---|---|---|
| Attack Origin (AO) | Arbitrary (AO:A) Specific (AO:S) | 1 0.2 |
| Attack Cost (AC) | Low (AC:L) Medium (AC:M) High (AC:H) | 1 0.67 0.33 |
| Attack Complexity (AX) | Low (AX:L) Medium (AX:M) High (AX:H) | 1 0.67 0.33 |
| IMPACT METRIC () | METRIC VALUE | NUMERICAL VALUE |
|---|---|---|
| Confidentiality (C) | None (C:N) Low (C:L) Medium (C:M) High (C:H) Critical (C:C) | 0 0.25 0.5 0.75 1 |
| Integrity (I) | None (I:N) Low (I:L) Medium (I:M) High (I:H) Critical (I:C) | 0 0.25 0.5 0.75 1 |
| Availability (A) | None (A:N) Low (A:L) Medium (A:M) High (A:H) Critical (A:C) | 0 0.25 0.5 0.75 1 |
| Deposit (D) | None (D:N) Low (D:L) Medium (D:M) High (D:H) Critical (D:C) | 0 0.25 0.5 0.75 1 |
| Yield (Y) | None (Y:N) Low (Y:L) Medium (Y:M) High (Y:H) Critical (Y:C) | 0 0.25 0.5 0.75 1 |
| SEVERITY COEFFICIENT () | COEFFICIENT VALUE | NUMERICAL VALUE |
|---|---|---|
| Reversibility () | None (R:N) Partial (R:P) Full (R:F) | 1 0.5 0.25 |
| Scope () | Changed (S:C) Unchanged (S:U) | 1.25 1 |
| Severity | Score Value Range |
|---|---|
| Critical | 9 - 10 |
| High | 7 - 8.9 |
| Medium | 4.5 - 6.9 |
| Low | 2 - 4.4 |
| Informational | 0 - 1.9 |
Critical
0
High
1
Medium
2
Low
3
Informational
24
| Security analysis | Risk level | Remediation Date |
|---|---|---|
| Missing Pallet Functionalities In Corresponding Precompiles Makes It Impossible To Call Them Through EVM Contracts | High | Solved - 01/21/2025 |
| Incorrect Implementation Of is_nominator In Staking Precompile | Medium | Solved - 01/20/2025 |
| Unavailable Features Due to Discrepancies Between Precompile and EVM Interface | Medium | Solved - 01/21/2025 |
| Miscalculated Selector Of The TransferNative Log | Low | Solved - 01/20/2025 |
| Missing TransferNative Event in ERC-20 Interface Implementation | Low | Solved - 01/20/2025 |
| Mismatch in Return Types Between Precompiles and EVM Interfaces | Low | Solved - 01/21/2025 |
| Potential Overflow in Deposit Accumulation | Informational | Solved - 01/19/2025 |
| Underflow in Stake Reduction | Informational | Solved - 01/19/2025 |
| Missing Unstake Amount validation | Informational | Solved - 01/19/2025 |
| Overflow in Operator Stake Addition | Informational | Solved - 01/19/2025 |
| Ensure APY and Cap Are Within Acceptable Ranges | Informational | Solved - 01/19/2025 |
| Missing Existing Stake Reduction Request Validation | Informational | Solved - 01/19/2025 |
| Underflow in Gas Calculation | Informational | Solved - 01/19/2025 |
| Potential Overflow in Total Supply Update in mint_claim | Informational | Solved - 01/19/2025 |
| Overflow Risk in current_reward_counter Commission Calculation | Informational | Solved - 01/19/2025 |
| Unhandled Results in verify_signature! Macro | Informational | Solved - 01/19/2025 |
| Hardcoded Gas Limit and Inconsistent Error Handling in on_register_hook | Informational | Solved - 01/19/2025 |
| Missing Era Validation in dispute Function | Informational | Not Applicable |
| Insecure Handling of Invalid Scalar Decoding in decode | Informational | Solved - 01/19/2025 |
| Possible Underflow on Balance Reduction | Informational | Solved - 01/19/2025 |
| Use Distinct Error for Pending Leave Round | Informational | Solved - 01/19/2025 |
| Presence Of Typos | Informational | Solved - 01/21/2025 |
| Presence Of TODOs | Informational | Solved - 01/21/2025 |
| Erroneous Documentation | Informational | Solved - 01/21/2025 |
| Missing Precompiles in Tangle Workspace | Informational | Solved - 01/21/2025 |
| Compilation Errors In `tangle-lst` Precompile | Informational | Solved - 11/07/2024 |
| Improper Mocking And Testing Of The `tangle-lst` Precompile | Informational | Solved - 11/07/2024 |
| Redundant Function In `services` Precompile | Informational | Solved - 12/19/2024 |
| Redundant Operations in move_claim for Identical Addresses | Informational | Solved - 01/19/2025 |
| Lack of Validation for Identity Element in deserialize Function | Informational | Solved - 01/19/2025 |
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
Halborn strongly recommends conducting a follow-up assessment of the project either within six months or immediately following any material changes to the codebase, whichever comes first. This approach is crucial for maintaining the project’s integrity and addressing potential vulnerabilities introduced by code modifications.
// Download the full report
Tangle Network Code Review
* Use Google Chrome for best results
** Check "Background Graphics" in the print settings if needed