# Incorrect rounding in the slashing factor calculation in the DelegationManager._getSlashing- Factor function

Precision loss in EigenLayer's slashing factor multiplication lets a staker be slashed up to 50% by an AVS while withdrawing the full stake.

- Payout: Contest reward
- Severity: high
- Program: Eigenlayer
- Credited: Audittens
- Disclosed: 2025-07-08
- Write-up quality: 8/10
- Original: https://cdn.cantina.xyz/reports/cantina_competition_eigenlayer_mar2025.pdf#3.1.2
- Library page: https://bugbountylibrary.com/r/cantina%3Aeigenlayer_mar2025%3A3.1.2
- Tags: domain:web3 impact:funds-loss impact:integrity kind:contest platform:cantina sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:business-logic vuln:precision-loss

**Target:** DelegationManager._getSlashingFactor / _completeQueuedWithdrawal (beaconChainETHStrategy)
**Root cause:** beaconChainSlashingFactor and operatorMaxMagnitude are multiplied together before multiplying by scaledShares; both can be tiny, so the product rounds down and a subsequent AVS slash changes maxMagnitude without changing the floored product.
**Steps:**
1. Create staker and operator accounts; create a fake AVS.
2. Register operator to fake AVS and slash it so maxMagnitude = DEN (e.g. 3e0).
3. Slash staker's beacon validators so beaconChainSlashingFactor L = floor((DEN-1)/NUM)/DEN - eps (e.g. 6.66e17).
4. Staker delegates to operator and deposits AMOUNT ETH into beaconChainETHStrategy.
5. Operator registers to victim AVS with magnitude NUM (e.g. 1e18).
6. Operator attacks victim AVS; staker immediately `queueWithdrawals` full stake (MEV to front-run slash).
7. Victim AVS slashes operator by NUM/DEN; maxMagnitude drops from 3e0 to 2e0 but floored product unchanged.
8. After MIN_WITHDRAWAL_DELAY_BLOCKS, `completeWithdrawalsAsTokens` returns full AMOUNT.
**How found:** Code review of _getSlashingFactorsAtBlock noticed beaconChainSlashingFactor * operatorMaxMagnitude multiplied before scaledShares, hypothesized floor collision when both factors are small, and constructed numeric example (2/3-eps)*3e-18 vs (2/3-eps)*2e-18 both flooring to 1e-18.
**Exploitation:** Attacker pre-conditions beaconChainSlashingFactor via repeated 32 ETH validator slashing cycles (losing X*P ETH over 36-day windows), then delegates large AMOUNT to a fresh operator, attacks a victim AVS, and front-runs the slash with a full withdrawal so the floored slashing factor is identical before and after, withdrawing the entire stake.
**Escalation:** Repeatable against any number of AVSs by delegating to fresh operators with the same initial magnitude; arbitrarily large AMOUNT amplifies damage while preparation cost stays fixed.
**Insight:** When two small fixed-point factors are multiplied before a large scaledShares, check whether a slash that changes one factor can leave the floored product unchanged; test boundary values where floor(a*b) == floor(a*b').
