Open
Description
Description
COO can make an attractive offer with high price for the kitty. When kitty owner approves token for Offers contract, COO can downgrade his offer and fulfill it on behalf of user.
Scenario
- COO creates new offer for the token
- Owner sees offer and starts acceptance process by submitting 'approve' transaction to Kitty Core contract
- As soon as owners transaction is mined, COO submits 3 transactions: cancelOffer, createOffer and fulfillOffer in sequence.
- If COO's transactions are mined before owner's fulfillOffer transaction, COO can get token at minimal price.
Impact
COO can trick user into selling valuable token at minimal price. Since COO can use another account in his control to make and cancel offer and also COO can be changed by CEO any time, user cannot detect or prevent this kind of fraud in advance. High impact, low likelihood.
Reproduction
//create initial offer by COO account
const tokenId = 1;
let minimalValue = await offersContract.minimumTotalValue();
await offersContract.createOffer(tokenId, { value: 1000 * minimalValue, from: coo });
// wait for owner to approve token, cancel initial offer and create new one
await offersContract.cancelOffer(tokenId, { from: coo });
await offersContract.createOffer(tokenId, { value: minimalValue, from: coo });
// accept offer for owner and make sure token transfered
await offersContract.fulfillOffer(tokenId, 0, { from: coo });
const newOwner = await nftTokens.ownerOf(tokenId);
assert(newOwner === coo);
Fix
Either user should be able to set minimal acceptable price for the token before approving token for Offers contract or deny COO fulfilling offers on user behalf.
Metadata
Metadata
Assignees
Labels
No labels