Summary
100% of all REPORTED Findings have been addressed
- 0Acknowledged
- 2Risk Accepted
- 40Solved
- 42All Findings
- Critical2
- 2Solved
- High2
- 2Solved
- Medium3
- 2Solved
- 1Risk A.
- Low10
- 9Solved
- 1Risk A.
- Informational25
- 25Solved
Introduction#
Beranames engaged Halborn to conduct a security assessment on their smart contracts beginning on November 26th, 2024 and ending on December 12th, 2024. The security assessment was scoped to smart contracts in the GitHub repository provided to the Halborn team. Commit hashes and further details can be found in the Scope section of this report.
Assessment Summary#
The team at Halborn assigned a full-time security engineer to assess the security of the smart contracts. The security engineer is a blockchain and smart-contract security expert with advanced penetration testing, smart-contract hacking, and deep knowledge of multiple blockchain protocols.
The purpose of this assessment is to:
Ensure that smart contract functions operate as intended.
Identify potential security issues with the smart contracts.
In summary, Halborn identified some improvements to reduce the likelihood and impact of risks, which were mostly addressed by the Beranames team. The main ones were the following:
Modify the price calculation formula to ensure that the total price reflects the actual duration of the domain rental.Ensure that all fields in the register request struct are included in the payload used for signature validation.Include the discount in the price calculation during the name renewal.Ensure that the correct owner is passed when setting reverse record.Use OpenZeppelin's ECDSA library to handle signature unpacking and validation.Include the 'whenNotPaused' modifier to ensure that bidding is disabled when the contract is paused.Normalize all input names by converting them to a consistent format before processing.
Test Approach and Methodology#
Halborn performed a combination of manual review of the code and automated security testing to balance efficiency, timeliness, practicality, and accuracy in regard to the scope of the smart contract assessment. While manual testing is recommended to uncover flaws in logic, process, and implementation; automated testing techniques help enhance coverage of smart contracts and can quickly identify items that do not follow security best practices. The following phases and associated tools were used throughout the term of the assessment:
Research into the architecture, purpose, and use of the platform.
Smart contract manual code review and walkthrough to identify any logic issue.
Thorough assessment of safety and usage of critical Solidity variables and functions in scope that could lead to arithmetic related vulnerabilities.
Manual testing by custom scripts.
Graphing out functionality and contract logic/connectivity/functions (
solgraph).Static Analysis of security for scoped contract, and imported functions. (
Slither).Local or public testnet deployment (
Foundry,Remix IDE).
Risk Methodology#
4.1 EXPLOITABILITY
Attack Origin (AO):
Attack Cost (AC):
Attack Complexity (AX):
Metrics:
| EXPLOITABILITY METRIC () | METRIC VALUE | NUMERICAL VALUE |
|---|---|---|
| Attack Origin (AO) | Arbitrary (AO:A) | 1 |
| Specific (AO:S) | 0.2 | |
| Attack Cost (AC) | Low (AC:L) | 1 |
| Medium (AC:M) | 0.67 | |
| High (AC:H) | 0.33 | |
| Attack Complexity (AX) | Low (AX:L) | 1 |
| Medium (AX:M) | 0.67 | |
| High (AX:H) | 0.33 |
4.2 IMPACT
Confidentiality (C):
Integrity (I):
Availability (A):
Deposit (D):
Yield (Y):
Metrics:
| IMPACT METRIC () | METRIC VALUE | NUMERICAL VALUE |
|---|---|---|
| Confidentiality (C) | None (C:N) | 0 |
| Low (C:L) | 0.25 | |
| Medium (C:M) | 0.5 | |
| High (C:H) | 0.75 | |
| Critical (C:C) | 1 | |
| Integrity (I) | None (I:N) | 0 |
| Low (I:L) | 0.25 | |
| Medium (I:M) | 0.5 | |
| High (I:H) | 0.75 | |
| Critical (I:C) | 1 | |
| Availability (A) | None (A:N) | 0 |
| Low (A:L) | 0.25 | |
| Medium (A:M) | 0.5 | |
| High (A:H) | 0.75 | |
| Critical (A:C) | 1 | |
| Deposit (D) | None (D:N) | 0 |
| Low (D:L) | 0.25 | |
| Medium (D:M) | 0.5 | |
| High (D:H) | 0.75 | |
| Critical (D:C) | 1 | |
| Yield (Y) | None (Y:N) | 0 |
| Low (Y:L) | 0.25 | |
| Medium (Y:M) | 0.5 | |
| High (Y:H) | 0.75 | |
| Critical (Y:C) | 1 |
4.3 SEVERITY COEFFICIENT
Reversibility (R):
Scope (S):
Metrics:
| SEVERITY COEFFICIENT () | COEFFICIENT VALUE | NUMERICAL VALUE |
|---|---|---|
| Reversibility () | None (R:N) | 1 |
| Partial (R:P) | 0.5 | |
| Full (R:F) | 0.25 | |
| Scope () | Changed (S:C) | 1.25 |
| Unchanged (S:U) | 1 |
| Critical | High | Medium | Low | Informational |
| 9 - 10 | 7 - 8.9 | 4.5 - 6.9 | 2 - 4.4 | 0 - 1.9 |
Scope#
Assessment Summary & Findings Overview#
# | Title | Severity | Score | Status |
|---|---|---|---|---|
| Total price miscalculation due to rounding error | Critical | 9.4 | Solved12/11/2024 | |
| Incomplete payload validation in whitelist register | Critical | 9.4 | Solved12/16/2024 | |
| Discount discrepancy in renewal and registration pricing | High | 7.5 | Solved12/15/2024 | |
| Incorrect assignment of reverse record ownership | High | 7.5 | Solved12/16/2024 | |
| Insufficient signature validation | Medium | 6.3 | Solved12/16/2024 | |
| Bid submission permitted during paused contract state | Medium | 6.3 | Solved12/11/2024 | |
| Lack of name normalization in input handling | Medium | 6.3 | Risk Accepted12/17/2024 | |
| Potential misconfiguration of reserve price in auction setup | Low | 4.2 | Solved12/11/2024 | |
| Potential ineffectiveness in bid increment validation | Low | 4.2 | Risk Accepted12/17/2024 | |
| Inadequate validation of UTF-8 encoding in character length calculation | Low | 4.2 | Solved01/01/2025 | |
| Unchecked launch time in registrar | Low | 3.4 | Solved12/11/2024 | |
| Missing validation for initial time buffer configuration | Low | 3.4 | Solved12/11/2024 | |
| Potential overflow in price conversion due to silent truncation | Low | 3.4 | Solved12/19/2024 | |
| Inefficient removal of reserved names from the list | Low | 2.5 | Solved12/15/2024 | |
| Inefficient handling of duplicate name reservations | Low | 2.1 | Solved12/15/2024 | |
| Unsafe index handling in hexadecimal parsing | Low | 2.1 | Solved12/26/2024 | |
| Incomplete length validation in hexadecimal parsing | Low | 2.1 | Solved12/26/2024 | |
| Suboptimal gas usage due to post-increment in loops | Informational | 1.7 | Solved12/11/2024 | |
| Inefficient array allocation in settlement retrieval functions | Informational | 1.7 | Solved01/01/2025 | |
| Inclusion of uninitialized settlement data in results | Informational | 1.7 | Solved12/19/2024 | |
| Inclusion of unsettled auctions in settlement results | Informational | 1.7 | Solved12/19/2024 | |
| Inconsistent handling of uninitialized auction data | Informational | 1.7 | Solved12/19/2024 | |
| Inconsistent array lengths in data processing | Informational | 1.7 | Solved12/26/2024 | |
| Inconsistent use of encoding methods for Keccak256 hash calculation | Informational | 1.6 | Solved12/11/2024 | |
| Improper validation of return data | Informational | 1.6 | Solved01/26/2024 | |
| Validation gaps in delegate approval process | Informational | 1.6 | Solved01/06/2025 | |
| Missing protection against potential reentrancy attacks | Informational | 1.1 | Solved12/19/2024 | |
| Registry ownership transfer allows divergence from NFT ownership | Informational | 1.0 | Solved01/07/2025 | |
| Improper handling of odd-length hex strings | Informational | 1.0 | Solved12/26/2024 | |
| Asymmetry in event emission for ETH transfers | Informational | 0.8 | Solved12/11/2024 | |
| Lack of zero address check | Informational | 0.8 | Solved12/26/2024 | |
| Potential issue with casting msg.value to uint128 in auction contract | Informational | 0.8 | Solved12/11/2024 | |
| Missing validation for start and end IDs in settlement retrieval | Informational | 0.8 | Solved12/19/2024 | |
| Lack of range validation in settlement retrieval functions | Informational | 0.8 | Solved12/19/2024 | |
| Unbounded recursion in hash calculation | Informational | 0.8 | Solved01/01/2025 | |
| Bounds validation required for safe array access | Informational | 0.8 | Solved12/26/2024 | |
| Validation required for encrypted data integrity | Informational | 0.8 | Solved12/26/2024 | |
| Unused functions | Informational | 0.3 | Solved01/07/2025 | |
| Redundant code | Informational | 0.3 | Solved12/15/2024 | |
| Potential inconsistent state validation for NFT transfers | Informational | 0.3 | Solved12/11/2024 | |
| Lack of error transparency in delegatecall failures | Informational | 0.3 | Solved12/26/2024 | |
| Index validation missing when removing reserved names | Informational | 0.0 | Solved12/15/2024 |
Findings & Tech Details#
Description
Proof of Concept
Recommendation
Remediation Comment
Description
Proof of Concept
Recommendation
Remediation Comment
Description
Proof of Concept
Recommendation
Remediation Comment
Description
Proof of Concept
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Disclaimer#
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.
