The execution of an order transfers 1 token regardless of Order.amount #807
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate
This issue or pull request already exists
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Lines of code
https://github.com/code-423n4/2022-10-blur/blob/2fdaa6e13b544c8c11d1c022a575f16c3a72e3bf/contracts/matchingPolicies/StandardPolicyERC1155.sol#L33
https://github.com/code-423n4/2022-10-blur/blob/2fdaa6e13b544c8c11d1c022a575f16c3a72e3bf/contracts/matchingPolicies/StandardPolicyERC1155.sol#L59
Vulnerability details
Impact
An order can be placed for an arbitrary amount, which is relevant for ERC1155. But when matched and executed only 1 token is transferred. This can lead to problems with accounting for the user, expecting a transfer of Order.amount tokens, potentially with a loss of funds as a consequence.
Proof of Concept
StandardPolicyERC1155.sol hardcodes a return value of 1, which is passed to BlurExchange as the amount used in the
transferERC1155()
function.Tools Used
Code inspection
Recommended Mitigation Steps
Consider amending StandardPolicyERC1155.sol to make use of the Order.amount for ERC1155, either by allowing for the transfer of more than one token or by returning false in
canMatchMakerAsk()
andcanMatchMakerBid
for a match where Order.amount != 1 (e.g. by adding... && makerAsk.amount == 1 && takerBid.amount == 1
to the bool return).The text was updated successfully, but these errors were encountered: