# Valid redemption proposals can be disputed by decreasing collateral

decreaseCollateral fails to update ShortRecord.updatedAt, letting an attacker lower a short's CR after a valid redemption proposal and dispute it to steal the proposer's penalty fee.

- Payout: Audit contest
- Severity: high
- Program: DittoETH
- Found by: Cosine
- Disclosed: 2024-06-25
- Write-up quality: 8/10
- Original: https://github.com/code-423n4/2024-03-dittoeth-findings/issues/32
- Library page: https://bugbountylibrary.com/r/c4%3A2024-03-dittoeth%3AH-07
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:code4rena sev:high tech:evm tech:solidity technique:incomplete-fix technique:source-review vuln:access-control vuln:business-logic vuln:liquidation

**Target:** DittoETH RedemptionFacet.disputeRedemption / ShortRecordFacet.decreaseCollateral
**Root cause:** decreaseCollateral modifies a short record's collateral ratio but does not refresh updatedAt, so the DISPUTE_REDEMPTION_BUFFER check (updatedAt + 1h <= timeProposed) does not protect against post-proposal modifications.
**Steps:**
1. Set initialCR to 1.7; create three shorts with increasing CRs above initialCR (e.g. 70/80/100).
2. Victim calls `proposeRedemption(asset, proposalInputs, amount, MAX_REDEMPTION_FEE)` listing the two lowest-CR shorts.
3. Attacker calls `decreaseCollateral(asset, C.SHORT_STARTING_ID + 2, 0.3e18)` to push the third short's CR below the proposed shorts; updatedAt is unchanged.
4. Attacker calls `disputeRedemption(asset, redeemer, incorrectIndex=1, disputeShorter=sender, disputeShortId=shortId3)`; the buffer check passes because updatedAt is stale.
5. Attacker collects the proposer's penalty fee; can restore collateral afterward.
**How found:** Noticed that the dispute buffer relies on updatedAt, then audited every function that mutates a short record's CR and found decreaseCollateral omits the updatedAt write, breaking the intended 1-hour protection window.
**Exploitation:** Attacker owns a short with CR above those in a valid proposal, decreases its collateral in the same block/tx to fall below the proposal's CRs, disputes the proposal to earn the penalty fee, then re-increases collateral. No capital beyond an existing short is required.
**Insight:** When a security check depends on a timestamp/version field, enumerate every state-mutating function and verify each one bumps that field; a single omission turns a protective buffer into a bypass.

