What Happened
The pinned CauldronV4 source tracks debt usingelastic amounts and base shares. repayForAll and the conversion paths must preserve a meaningful relationship between the two. Reducing the debt amount while leaving shares outstanding creates a precision-sensitive state; a ratio computed from that state is not an independent solvency check. Pinned CauldronV4 source.
Attack Mechanism
Cauldron debt uses a rebase:elastic is the debt amount and base is the total number of debt shares. A user’s debt is derived from their share of base, scaled by elastic.
repayForAll reduces the amount owed without necessarily reducing every borrower’s shares. When the amount becomes very small relative to the share count, integer rounding becomes significant. Reaching elastic = 0 with base > 0 is particularly dangerous: conversion code may take its zero-value initialization branch while old shares still exist.
Consider a state with no debt amount but a large outstanding share count. If the next borrow creates new shares at a 1:1 ratio, those shares represent only a tiny fraction of the old total. A subsequent debt calculation can understate the new borrower’s obligation. A solvency check based on that same damaged ratio is not an independent safeguard.
The narrow assertion below rejects the zero-amount/nonzero-shares state. It uses staticcallAt to read totalBorrow() at transaction end.
Assertion Example
What This Check Covers
This check only covers the stated zero state at transaction end. It can miss a temporary inconsistent state or harmful rounding whileelastic remains positive. Debt forgiveness, repayment, borrow conversions, and each operation’s solvency need separate tests; do not treat this one condition as a complete replay of the exploit.

