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

Potential hash collision when using abi.encodePacked() with multiple variable-length arguments #57

Closed
2 tasks
indeqs opened this issue Jun 1, 2024 · 0 comments

Comments

@indeqs
Copy link
Contributor

indeqs commented Jun 1, 2024

Checklist

  • [✅] I have searched the existing issues and pull requests for duplicates.

Type of Issue

  • [✅] New vulnerability addition
  • Feature request
  • Update existing vulnerability

Description

Using abi.encodePacked() with multiple variable-length arguments can, in certain situations, lead to a hash collision. Since abi.encodePacked() packs all elements in order regardless of whether they're part of an array, you can move elements between arrays and, so long as all elements are in the same order, it will return the same encoding. In a signature verification situation, an attacker could exploit this by modifying the position of elements in a previous function call to effectively bypass authorization.

Sources

@indeqs indeqs mentioned this issue Jun 1, 2024
2 tasks
@indeqs indeqs closed this as completed Jun 7, 2024
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

No branches or pull requests

1 participant