Griefing (e.g. no profit motive for an attacker, but damage to the users or the protocol)
Description
An attacker may essentially be able to grief the reserves of the token which can impact the users who've contributed to the pool overall, by obtaing an AmountOut that is greater than the Reserve amount, leading to negative reserves from calling another function.
Vulnerability Details
In Well.sol, there isn't any checks to make sure the AmountOut can't exceed the Reserve Amount, With logic denoting AmountOut from user transfers.
This has no checks for AmountOut, and amountOut can be freely called from its initialization from Swapfrom. Called again, the AmountOut which > Reserves and be subtracted from reserves from 2nd function (SwapIn) without any checks to make sure reserves aren't negative, which can impact the other users who contribute to the protocol to the reserves.
Impact Details
This would lead to potential griefing on behalf of the attacker which would negatively impact the users of the reserve who're providing liquidity, but there wouldn't really be any benefit to the attacker by doing so, besides the damage
// Attacker utilizes this function to cause reserve damages.
function getSwapIn(
IERC20 fromToken,
IERC20 toToken,
uint256 amountOut
) external view readOnlyNonReentrant returns (uint256 amountIn);
}
contract Well { address immutable Well2 = 0xBA51AAAA95aeEFc1292515b36D86C51dC7877773;
Unfortunately, after reviewing your report, Immunefi has decided to close it due to the assessed impact being out of scope.
Immunefi review:
The claimed impact "Griefing" by the whitehat is in scope of the bug bounty program but the assessed impact doesn't match with the claimed impact for the following reasons.
In version above 0.8, solidity will throw error for overflow/underflow, which makes the issue invalid.
assessed asset by the triage team is in scope for the bug bounty program
PoC has not been submitted to the project
Please note that the project will receive a report of the closed submission and may choose to re-open it, but they are not obligated to do so.