Open hats-bug-reporter[bot] opened 5 months ago
We don't use permitTransferFromERC1155
in the code.
PermitC
is OOS. Only Pearlmit
and PearlmitHash
are.
@JeffCX This one is
wait a minutes,
scope
contracts/pearlmit/Pearlmit.sol contracts/pearlmit/PearlmitHash.sol
and if pearlmit is in scope
the contract inherit from PermitC
contract Pearlmit is PermitC {
also this permitTransferFromERC1155 / permitTransferFromERC20 is there for anyone to use.
That's correct, but we don't use it in the protocol. If someone uses it, it's outside of the protocol.
Github username: -- Twitter username: -- Submission hash (on-chain): 0x25bdc5b095d9c0a48bbd14b57946335f137f38214d574b2708bb43a371ee0dc1 Severity: medium
Description: Description\
In PermitC,
we have function permitTransferFromERC1155 / permitTransferFromERC20
the _checkPermitApproval calls
as we can see, the permitAmount is a part of schema to compose the hash,
but the user can input any transferAmount
consider the case:
because 1 or 0.0001 token is below the permitAmount 10000.
same issue applies to ERC20 permit transaction, and does not apply to ERC721 token transfer because the code enforce that the permitAmount and transferAmount are both one.
Attack Scenario\
See above. all permit ERC1155 token transfer and permit ERC20 token can be constantly griefed.
the recommendation is that enforce transferAmount == permitAmount.
Attachments
Proof of Concept (PoC) File
Revised Code File (Optional)