Summary
100% of all REPORTED Findings have been addressed
- 2Acknowledged
- 1Risk Accepted
- 4Solved
- 7All Findings
- Critical0
- High0
- Medium3
- 3Solved
- Low1
- 1Risk A.
- Informational3
- 1Solved
- 2Ack.
Introduction#
CoreDAO engaged Halborn to conduct a security assessment of the BTCFi Lending Vault contracts developed by the b14g team from August 28th to September 4th, 2025. The scope of this assessment was limited to the smart contracts provided to the Halborn team. Commit hashes and additional details are documented in the Scope section of this report.
Assessment Summary#
The Halborn team dedicated a total of five days to this engagement, deploying one full-time security engineer to evaluate the smart contracts’ security posture.
The assigned security engineer is an expert in blockchain and smart contract security, with advanced skills in penetration testing, smart contract exploitation, and a comprehensive understanding of multiple blockchain protocols.
The objectives of this assessment were to:
Verify that the smart contract functions operate as intended.
Identify potential security vulnerabilities within the smart contracts.
In summary, Halborn identified several areas for improvement to reduce both the likelihood and impact of potential risks, which were partially addressed by the b14g team. The primary suggestions included:
Implement comprehensive oracle data validation with staleness and confidence checks before using prices in calculations.Establish proper historical reward state tracking to prevent exploitation of uninitialized mapping slots.Add health factor validation after pool withdrawals to prevent liquidation risk.Implement proper error handling for external contract calls with try-catch blocks.Add event emissions for all administrative parameter changes to enhance transparency.Make critical addresses configurable instead of hardcoded to support network flexibility.
Test Approach and Methodology#
Halborn employed a combination of manual, semi-automated, and automated security testing methods to ensure effectiveness, efficiency, and accuracy within the scope of this assessment. Manual testing was vital for uncovering issues related to logic, processes, and implementation details, while automated techniques enhanced code coverage and helped identify deviations from security best practices. The assessment involved the following phases and tools:
Research into the architecture and purpose of the smart contracts.
Manual review and walkthrough of the smart contract code.
Manual evaluation of critical Solidity variables and functions to identify potential vulnerability classes.
Manual testing using custom scripts.
Static security analysis of the scoped contracts and imported functions utilizing
Slither.Local deployment and testing with
Foundry.
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 |
|---|---|---|---|---|
| Stale Oracle Data Enables Slippage Protection Bypass | Medium | 5.0 | Solved09/05/2025 | |
| Historical Data Loss Enables Reward Theft | Medium | 5.0 | Solved09/05/2025 | |
| Pool Withdrawal Without Health Factor Validation | Medium | 5.0 | Solved09/05/2025 | |
| Unchecked External Call Return Values | Low | 3.4 | Risk Accepted09/10/2025 | |
| Operator Role Centralization Risk | Informational | 1.9 | Solved09/10/2025 | |
| Silent Changes Reduce Transparency | Informational | 1.0 | Acknowledged09/10/2025 | |
| Hardcoded Network Addresses Reduce Flexibility | Informational | 0.0 | Acknowledged09/10/2025 |
Findings & Tech Details#
Description
Recommendation
Description
Recommendation
Description
Recommendation
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
Description
Recommendation
Remediation Comment
8. Automated Testing#
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.
