Open hats-bug-reporter[bot] opened 9 months ago
As stated in the challange description - bugs arising from usage of non-standard/malicious PSP22Token implementations are out-of-scope. Yours is just one of many exploits that can happen with modified PSP22. Another, simple case of such exploit would be a PSP22 token where transfer function transfers all of the tokens to the hacker, rather than actual recipient.
Thank you for participation. After carefully reviewing the submission we've concluded that this issue is INVALID.
We hope you participate in the future audits of ink!.
Github username: -- Twitter username: -- Submission hash (on-chain): 0xa7a40cdebd04945b9c078a75f783b12a36a729c2dfdb49cc4be506ae95adf556 Severity: high
Description: Description\ In
pair.lib.rs
, a new pair can be added using:However, there is no checks that these tokens added are actually fully PSP22 compatible.
Attack Scenario\ Alice creates a token pair: tX, tY
tX and tY implement the functions of a regular
PSP22
:transfer
andtransfer_from
functions to empty the native balance of a swapper.router/lib.rs::swap_exact_tokens_for_tokens
:psp22_transfer_from
gets called, executing the malicious function set by Alice.Attachments