hats-finance / AlephZeroAMM-0x0d88a9ece90994ecb3ba704730819d71c139f60f

Apache License 2.0
1 stars 0 forks source link

Users can steal funds of others by honeypotting them during swaps #2

Open hats-bug-reporter[bot] opened 9 months ago

hats-bug-reporter[bot] commented 9 months ago

Github username: -- Twitter username: -- Submission hash (on-chain): 0xa7a40cdebd04945b9c078a75f783b12a36a729c2dfdb49cc4be506ae95adf556 Severity: high

Description: Description\ In pair.lib.rs, a new pair can be added using:

        pub fn new(token_0: AccountId, token_1: AccountId) -> Self {
            let pair = PairData::new(token_0, token_1, Self::env().caller());
            Self {
                psp22: PSP22Data::default(),
                pair,
            }
        }

However, there is no checks that these tokens added are actually fully PSP22 compatible.

Attack Scenario\ Alice creates a token pair: tX, tY

Attachments

  1. Proof of Concept (PoC) File
deuszx commented 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.

deuszx commented 9 months ago

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!.