Prepared by:
HALBORN
Last Updated Unknown date
Date of Engagement: June 17th, 2024 - July 17th, 2024
100% of all REPORTED Findings have been addressed
All findings
9
Critical
0
High
0
Medium
0
Low
6
Informational
3
Allbridge engaged Halborn to conduct a security assessment of the Bridge and ERC20 contracts, beginning on June 17th, 2024 and ending on July 17th, 2024. This security assessment was scoped to the smart contracts in the bridge-casper-contract GitHub repository.
Allbridge is a simple and reliable tool for moving assets between different blockchain networks. It contributes to a more connected blockchain world by enabling easy and fast transfers, allowing assets to move quickly, similar to normal transactions on any blockchain. Allbridge also offers the flexibility to choose how to send and receive tokens, whether they are native to the blockchain or wrapped versions.
The team at Halborn assigned a full-time security engineer to verify 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 acknowledged by the Allbridge team. The main ones are the following:
The status of the token should be checked before performing any operations.
The access permission of the constructor entry point should be changed to Groups since a user group is created.
The fee rate should be checked to ensure it is lower than 100% or under a maximum threshold to avoid unintended errors.
The ERC20 contract should provide a mechanism for upgrades if needed.
The lock_id should be validated in conjunction with the transaction sender's address to avoid forged lock requests.
Ownership should be transferred in a two-step process to avoid lossing the control of the contract.
Halborn performed a combination of the manual view of the code and automated security testing to balance efficiency, timeliness, practicality, and accuracy regarding 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 the coverage of smart contracts. They 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 architecture, purpose, and use of the platform.
Manual code read and walk through.
Manual Assessment of use and safety for the critical Rust variables and functions in scope to identify any arithmetic related vulnerability classes.
Cross contract call controls.
Architecture related logical controls.
Scanning of Rust files for vulnerabilities (cargo audit)
Integration testing using the Casper Engine Test Support.
Tesnet deployment and comprehensive review of transactions through the CPSR live explorer.
| 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
0
Medium
0
Low
6
Informational
3
| Security analysis | Risk level | Remediation Date |
|---|---|---|
| Unlock operation could be done on disabled tokens | Low | Risk Accepted |
| Incorrect access permissions in constructor entry point | Low | Risk Accepted |
| Fee rate not validated | Low | Risk Accepted |
| Lack of contract upgrade capability | Low | Risk Accepted |
| Potential lock ID forgery leading to DoS | Low | Risk Accepted |
| Owneship transfer in one step | Low | Risk Accepted |
| Compliance with Casper Fungible Token Standard (CEP-18) | Informational | Acknowledged |
| Redundant code | Informational | Acknowledged |
| Missing argument on entry point | Informational | Acknowledged |
//
//
//
//
//
//
//
//
//
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
Bridge Contracts
* Use Google Chrome for best results
** Check "Background Graphics" in the print settings if needed