-
Notifications
You must be signed in to change notification settings - Fork 30
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
Fixing Vulnerable Vote Function #15
Comments
Hi there, I made a PR fixing this issue. The updated vote function now checks if the sender is authenticated before proceeding with the voting process. The authentication was already being done in |
@a-singh09 I've fixed this issue already and was waiting for @harsh-mr to reply first. Secondly the issue you've solved is not complete as the function is still vulnerable. The vote function can be manipulated to fake votes as I can just use the contract address to hinder the elections by passing my own arguments while voting posing to be another voter. |
Hey, wasn't aware of you already fixed this issue and secondly, modified my code as per your suggession. |
Hey, I've fixed the issue on local but didn't commit the PR as I was waiting for confirmation from Mentors. Your code still holds vulnerability. I'll Pull a PR for this issue soon, you can have a look at it ! |
Fixing Vulnerable Vote Function
Analysis of Attack
This vulnerability arises from the ability to manipulate the voting process by inserting fake user addresses into the contract. Malicious actors could exploit this weakness to cast fraudulent votes, undermining the credibility and fairness of the election.
Risk - High
Likelihood - High
This code snippet is vulnerable because it allows anyone to directly use the Diamond Proxy contract's address to cast a vote, bypassing any authentication or authorization checks based on the sender's identity (msg.sender).
As the attacker's loop continues to execute indefinitely, it effectively floods the contract with fraudulent votes, potentially overwhelming the contract and disrupting its functionality.
Possible Implementation
To mitigate this vulnerability, the code should be updated to ensure that only authorized users are allowed to cast votes, possibly by using msg.sender for authentication checks instead of relying solely on the _voter parameter.
The text was updated successfully, but these errors were encountered: