Report ID
#30125
Report type
Smart Contract
Has PoC?
Yes
PoC Link
https://gist.github.com/Sentient-XII/1ee73b14df418fe8e565a0a77b1492c1
Target
https://etherscan.io/address/0xC1E088fC1323b20BCBee9bd1B9fC9546db5624C5
Impacts
- Contract fails to deliver promised returns, but doesn't lose value
- Griefing (e.g. no profit motive for an attacker, but damage to the users or the protocol)
Description
In the MarketPlaceFacet.sol when users create listings by calling function createPodListing, the uin256 minFillAmount can be set to large values as large as type(uint256).max because there is no range check for minimum fill value. Essentially, setting minFillAmount to the maximum value creates an impossible condition for buyers. No transaction can fulfill the requirement of buying uint256.max pods, so no purchase can be made.
Vulnerability Details
Users can list pods by calling the following function that calls an internal function of the same name, however there is no range check for minimum value that can lead to impossible to fill amounts.
When user calls function fillListing that calls the corresponding private function fillListing this check will always fail require(amount >= l.minFillAmount, "Marketplace: Fill must be >= minimum amount.");
Impact Details
Attackers can use this to list pod for sale that only they can cancel, essentially leading to no pods being filled.
- Contract fails to deliver promised returns, but doesn't lose value
- Griefing (e.g. no profit motive for an attacker, but damage to the users or the protocol)
References
Add any relevant links to documentation or code
Proof of concept
- mkdir beanPOC
- cd beanPOC
- forge init (delete default Counter.sol and Counter.t.sol)
- run with
forge test --contracts ./src/beanMarket.sol -vv
https://gist.github.com/Sentient-XII/1ee73b14df418fe8e565a0a77b1492c1