Should use >= instead of >
A comparison in the VaultTracker contract used a strict greater-than instead of greater-than-or-equal, so removing or transferring notional could leave a tiny dust amount behind. An attacker could repeatedly trigger this to leak small amounts of value from the contract.
Submitted by oyc_109
The comparison should be ‘a >= vlt.notional’ instead of a > vlt.notional.
Otherwise dust amounts will always be left in vlt.notional when calling removeNotional() or transferNotionalFrom().
JTraversa (Swivel) confirmed, but disagreed with severity and commented:
While the leakage is potentially … 1 wei, its leakage nonetheless and a frontend would surely provide the max amount most of the time leading to reverts.
Maybe a quick severity review from wardens but happy with where its at.
I agree that this is quite low stakes, given that there is non-zero potential leakage I think the warden should get credit for this as a Medium Risk vulnerability. Per the C4 juging criteria:
2 — Med: Assets not at direct risk, but the function of the protocol or its availability could be impacted, or leak value with a hypothetical attack path with stated assumptions, but external requirements.
Addressed: https://github.com/Swivel-Finance/gost/pull/423.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the comparison used a strict greater-than operator where greater-than-or-equal was needed, so an exact balance match was not cleared.
Impact
Only a tiny amount (potentially one wei) could leak per call, and a frontend sending the maximum amount would often cause reverts instead.
What the attacker needed
Ability to call removeNotional or transferNotionalFrom
The fix
The comparison was changed to greater-than-or-equal and the issue was addressed in a pull request.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Smart contracts track balances with numbers. When a check uses 'greater than' instead of 'greater than or equal to', a tiny leftover amount (called dust) can stay stuck in the contract. Over many calls, that leftover could add up to a small loss.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.