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

Add detector and test_cases dos-unexpected-revert-with-map #251

Open
5 tasks
arturoBeccar opened this issue Jun 25, 2024 · 0 comments
Open
5 tasks

Add detector and test_cases dos-unexpected-revert-with-map #251

arturoBeccar opened this issue Jun 25, 2024 · 0 comments

Comments

@arturoBeccar
Copy link
Member

Problem Description

Be careful about the usage of Map, it is not the same as a Mapping in Soroban, and has similar storage limitations to Vec. To implement a Mapping equivalent, define an appropriate dictionary structure with Enum.

If using Map, make sure that authorization is required to add new elements, since this structure has storage limitations that could lead to a Denial of Service.

Tasks

  • Add new detector. Follow the same pattern as dos-unexpected-revert-with-vector, but check for usage of Map instead of Vec.

dos-unexpected-refert-with-map

  • Add vulnerable test case, using Map, for example, to count votes.
  • Add remediated test case solving the issue with a require auth.
  • Add remediated test case using a dictionary structure with `Enum.
  • Add detector documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant