Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve "echo" detection #2057

Merged
merged 2 commits into from
Oct 25, 2024
Merged

Improve "echo" detection #2057

merged 2 commits into from
Oct 25, 2024

Conversation

iamacook
Copy link
Member

Summary

An "echo" poisoning attempt is when an attacker sends a small amount of a token back to you after sending some to a receipient. The token address is therefore the same, the value low and the recipient similar in vanity.

This fixes the token address comparison as we were previously comparing a token against itself, and it adds a vanity check.

Changes

  • Fix token address comparison
  • Add vanity check
  • Adjust tests accordingly

@iamacook iamacook self-assigned this Oct 25, 2024
@iamacook iamacook requested a review from a team as a code owner October 25, 2024 07:51
@iamacook iamacook requested a review from schmanu October 25, 2024 07:54
return false;
}

return this.isImitationAddress(txInfo, prevTxInfo);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whilst this check occurs in both methods, I thought it clearer to include it in both.

@iamacook iamacook marked this pull request as draft October 25, 2024 07:57
@iamacook iamacook marked this pull request as ready for review October 25, 2024 08:09
@iamacook iamacook merged commit 474f437 into main Oct 25, 2024
20 checks passed
@iamacook iamacook deleted the improve-echo-parameters branch October 25, 2024 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants