Summary
100% of all REPORTED Findings have been addressed
- 0Risk Accepted
- 1Not Applicable
- 12Solved
- 13All Findings
- Critical4
- 4Solved
- High1
- 1N/A
- Medium4
- 4Solved
- Low4
- 4Solved
- Informational0
Introduction#
XRPL Foundation engaged Halborn to conduct a focused security assessment of the current system, with particular emphasis on the new XLS-66 Lending Protocol. The engagement took place from 21 July 2025 to 05 August 2025. The scope, detailed in the scope section, encompassed all modules implementing or interacting with Lending functionality, including Loan, Vault, LoanBroker, batch helpers, invariants, and the supporting math/utilities—along with the unit-test harness and newly developed fuzzers.
The XRPL (XRP Ledger) is a decentralized layer-1 network supporting payments, tokenization, and, through recent amendments, increasingly sophisticated DeFi primitives. XLS-66 extends this stack with native collateralized lending: borrowers open Vaults, draw Loans, and interact with on-ledger Loan Brokers that manage interest, fees, and claw-backs.
While the amendment introduces powerful functionality, it also adds complex state machines, long-lived accounting fields, and precision-sensitive arithmetic—areas prone to subtle security vulnerabilities. Ensuring the protocol’s correctness is therefore critical to safeguarding user funds and maintaining XRPL’s low-latency, deterministic consensus guarantees.
Assessment summary#
Halborn assigned a full-time senior security engineer specializing in C++ ledger internals, consensus protocols, and decentralized finance. The objectives were to:
• Verify that Lending logic strictly enforces its economic and safety invariants
• Identify vulnerabilities that could result in fund loss, ledger corruption, consensus failure, or denial of service
All identified issues are reproducible with single transactions at standard fees. Proof-of-Concepts (PoCs) have been provided. Full details and remediation guidance are available in the Findings section.
Methodology#
Halborn employed a hybrid approach:
• Architectural review of XLS-66 data flow and state machines
• Manual source code inspection of C++ transaction paths, helpers, and invariants
• Differential analysis comparing pre-Lending behavior
• Custom invariant-enabled fuzzers
Risk Methodology#
3.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 |
3.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 |
3.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 |
|---|---|---|---|---|
| Loan-Set inside Batch bypasses Counter-party Signature | Critical | 10.0 | Solved07/29/2025 | |
| LoanPay Triggers Unbounded Loop in loanComputePaymentParts | Critical | 10.0 | Solved10/05/2025 | |
| Negative LoanOriginationFee Breaks accountSendMPT Invariant | Critical | 10.0 | Solved10/24/2025 | |
| Zero InterestRate in LoanSet Causes LoanPay divide-by-zero | Critical | 10.0 | Solved07/23/2025 | |
| EscrowFinish Accepts Unbounded Size crypto-condition | High | 7.5 | Not Applicable07/30/2025 | |
| LoanPay Writes Over-Precision debtDecrease | Medium | 6.3 | Solved10/16/2025 | |
| LoanPay Can Drive totalInterestOutstanding Below Zero | Medium | 6.3 | Solved10/21/2025 | |
| LoanPay Stores Inconsistent Principal | Medium | 6.3 | Solved10/21/2025 | |
| LoanPay Writes Over-Precision totalPrincipalPaid | Medium | 5.6 | Solved10/21/2025 | |
| LoanPay Stores Over-Precision totalInterestPaid | Low | 3.1 | Solved10/21/2025 | |
| LoanSet allows an overflow in NextPaymentDueDate | Low | 3.1 | Solved10/26/2025 | |
| LoanSet accepts out-of-range InterestRate | Low | 2.5 | Solved07/30/2025 | |
| DebtMaximum = 0 Mistakenly Blocks All Loans | Low | 2.5 | Solved07/30/2025 |
Findings & Tech Details#
Description
Proof of Concept
Recommendation
Description
Proof of Concept
Recommendation
Description
Proof of Concept
Recommendation
Description
Proof of Concept
Recommendation
Description
Recommendation
Remediation Comment
Description
Proof of Concept
Recommendation
Description
Proof of Concept
Recommendation
Description
Recommendation
Description
Proof of Concept
Recommendation
Description
Proof of Concept
Recommendation
Description
Recommendation
Description
Recommendation
Description
Proof of Concept
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.
