Reproduced Exploit
Accountable — `AccountableOpenTerm` interest cannot be repaid once principal hits zero
1. Interest accrues virtually via _scaleFactor / scaleFactor. 2. repay() only reduces outstandingPrincipal; excess for interest is optional. 3. When principal reaches zero the loan flips to Repaid. 4. In Repaid, _requireLoanOngoing() blocks further supply/repay, and sharePrice falls back to assetSh…
Chain
Other
Category
logic
Date
Oct 2025
Source
AuditVault
EVM Playground
Source-level debugger — step opcodes and Solidity in sync
The attack is replayed in an in-browser EVM preloaded with the exact dumped fork state. The execution tree shows every call; step by Solidity line or by opcode across all depths — source, Stack, Memory, Storage, Balances (native / ERC-20 / NFT), Transient storage and Return value stay in sync. Click a tree node, opcode, or source line to jump. No backend, no live RPC.
Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 62973-accountableopenterm-loan-interest-cannot-be-repaid-once-prin. Standalone Foundry PoC and full write-up: 62973-accountableopenterm-loan-interest-cannot-be-repaid-once-prin_exp in the
evm-hack-registrymirror.
Vulnerability classes: vuln/logic/debt-accounting · fee-theft · debt-accrual-update
Reproduction: a self-contained Foundry PoC that compiles & runs in an isolated project with only
forge-std— no fork, no RPC, noanvil_state. Full trace: output.txt. PoC: test/62973-accountableopenterm-loan-interest-cannot-be-repaid-once-prin_exp.sol.
AuditVault taxonomy: severity/high · sector/lending · sector/stable · platform/cyfrin · decimal-mismatch · fee-theft · debt-accrual-update · fee-accounting
Key info#
| Impact | HIGH — accrued interest permanently forgiven; LPs receive principal only |
| Protocol | Accountable — AccountableOpenTerm |
| Vulnerable code | repay() marks loanState = Repaid when outstandingPrincipal hits zero without collecting scale-factor interest |
| Bug class | Principal-first debt model leaves virtual interest unpayable after Repaid |
| Finding | Cyfrin 2025-10-16 Accountable v2.0 · #62973 · reporter Immeas |
| Report | Cyfrin Accountable v2.0 |
| Source | AuditVault |
| Status | Audit finding — fixed (debt shares). Reproduced as a standalone local PoC. |
| Compiler | ^0.8.24 (PoC) |
TL;DR#
- Interest accrues virtually via
_scaleFactor/scaleFactor. repay()only reducesoutstandingPrincipal; excess for interest is optional.- When principal reaches zero the loan flips to
Repaid. - In
Repaid,_requireLoanOngoing()blocks furthersupply/repay, andsharePricefalls back toassetShareRatio(ignores scale factor). - All accrued interest is permanently unpayable — LPs get 0 yield.
The vulnerable code#
if (assets >= outstandingPrincipal) {
outstandingPrincipal = 0;
loanState = LoanState.Repaid; // @> VULN: principal-zero → Repaid without requiring interest
// FIX: burn debt shares at current scaleFactor; Repaid only when debtShares == 0
}
Root cause#
Liability is tracked as principal with a separate virtual scale factor, but the only funding paths reduce principal first. Hitting principal zero is treated as full repayment even when scale factor implies unpaid interest.
Preconditions#
- Open-term loan with positive interest rate; principal outstanding.
- Time passes so
scaleFactor > PRECISION. - Borrower repays exactly principal (maliciously or accidentally).
Attack walkthrough#
- LP deposits
USDC_AMOUNT; borrower draws full principal. - Accrue ~180 days of interest →
scaleFactor > 1e36. - Borrower repays exactly principal →
loanState = Repaid. sharePricereturns 1:1assetShareRatio(no interest realized).- Further
supply(1)reverts via_requireLoanOngoing().
Diagrams#
Impact#
LPs systematically underpaid; a borrower can always avoid interest by repaying principal before realizing it. Unintentional last payments that exhaust principal have the same effect.
Sources#
- AuditVault finding #62973
- Cyfrin Accountable v2.0 report
- Reduced source: Accountable-Protocol
AccountableOpenTerm—repay/_requireLoanOngoing/sharePrice(fixed infce6961,8e53eba)
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 62973-accountableopenterm-loan-interest-cannot-be-repaid-once-prin_exp (evm-hack-registry mirror).
- AuditVault finding: 62973-accountableopenterm-loan-interest-cannot-be-repaid-once-prin.
Alerts & third-party analyses
These dashboards index community alerts tweets, post-mortems, and independent write-ups. Reach them through the protocol name above to cross-check this reproduction against other analyses.