Summary
100% of all REPORTED Findings have been addressed
- 0Acknowledged
- 0Risk Accepted
- 10Solved
- 10All Findings
- Critical0
- High0
- Medium1
- 1Solved
- Low3
- 3Solved
- Informational6
- 6Solved
Introduction#
Odra engaged Halborn to conduct a security assessment of the Liquid Staking contract, beginning on April 21st, 2025 and ending on April 28th, 2025. This security assessment was scoped to the smart contracts in the liquid-staking-contracts GitHub repository.
This project implements a Liquid Staking protocol for CSPR on the Casper blockchain. It allows users to stake CSPR and receive a fungible token, sCSPR, which represents their share of the staked assets and can be used freely while earning rewards.
Assessment Summary#
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 successfully addressed by the Odra team. The main ones were the following:
Ensure remove_validator calls collect_fee() before undelegation and updates last_recorded_delegated_amount after.Expose a secure admin-only ownership transfer function, either via delegation or a custom wrapper.Enforce a maximum fee_percentage (e.g., 20%) and revert in init() if it exceeds 10,000 basis points (100%).Restrict withdraw_from_the_contract to only allow withdrawal of CSPR explicitly contributed by the add_to_the_pool function, and enforce automatic or mandatory re-delegation after any undelegation triggered by remove_validator or remove_from_the_pool.
Test Approach and Methodology#
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)Test analysis using the BDD system deployed with
Cucumbertool.
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 |
|---|---|---|---|---|
| Validator removal bypasses fee collection and breaks delegation tracking | Medium | 5.0 | Solved05/21/2025 | |
| Admin can extract backed CSPR and devalue sCSPR through stake manipulation | Low | 2.5 | Solved05/14/2025 | |
| Contract lacks mechanism to transfer ownership after deployment | Low | 2.0 | Solved05/07/2025 | |
| Lack of validation on fee percentage allows inflation abuse | Low | 2.0 | Solved05/05/2025 | |
| Users can delegate CSPR without receiving sCSPR | Informational | 1.6 | Solved05/06/2025 | |
| Predictable validator selection due to weak randomness | Informational | 0.0 | Solved05/07/2025 | |
| Lack of error handling when adding an already registered validator | Informational | 0.0 | Solved05/05/2025 | |
| Unused constant MIN_STAKE and lack of validation allow unsafe initialization | Informational | 0.0 | Solved05/05/2025 | |
| Unmodifiable claim time prevents governance from adapting unstaking delays in the future | Informational | 0.0 | Solved05/05/2025 | |
| Incorrect sCSPR-to-CSPR conversion when no backing stake or supply exists | Informational | 0.0 | Solved05/06/2025 |
Findings & Tech Details#
Description
Recommendation
Description
Recommendation
Description
Recommendation
Description
Recommendation
Description
Recommendation
Description
Recommendation
Description
Recommendation
Description
Recommendation
Description
Recommendation
Description
Recommendation
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.
