Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: low
Valid

Missing Access Control on Vote Recording Allows Arbitrary Vote Spoofing

Summary

The recordVote function in veRAACToken lacks access control, allowing anyone to record votes on behalf of any user, potentially compromising the integrity of the governance system. This vulnerability could be exploited to manipulate voting outcomes by falsely recording votes for arbitrary addresses.

Vulnerability Details

The recordVote function in veRAACToken is designed to record votes for governance proposals and prevent double voting. However, its implementation has a critical security flaw:

function recordVote(address voter, uint256 proposalId) external {
if (_hasVotedOnProposal[voter][proposalId]) revert AlreadyVoted();
_hasVotedOnProposal[voter][proposalId] = true;
uint256 power = getVotingPower(voter);
emit VoteCast(voter, proposalId, power);
}

The key issues is that:
The function lacks any modifier or check to verify that the caller is authorized to record votes. Unlike other sensitive functions in the contract that use modifiers like onlyOwner or check for specific roles, this function is completely unprotected.

The proper implementation should ensure that only:

  • The actual voter (msg.sender) can record their own vote

  • Or a designated governance contract with proper authorization can record votes

PoC

  1. Alice holds 1000 veRAACToken and intends to vote on proposal ID 1

  2. Bob (malicious actor) calls recordVote(alice, 1) before Alice can vote

  3. The transaction succeeds, recording a vote for Alice without her consent

  4. When Alice tries to actually vote on proposal 1, the transaction reverts with AlreadyVoted

  5. Bob has effectively blocked Alice from participating in governance

Impact

  • Unauthorized recording of votes for any address

  • Denial of legitimate voting rights

  • Manipulation of governance outcomes

  • False voting records that could affect governance decisions

Tools Used

Manual code review

Recommendations

Add authentication to ensure only authorized entity can record voter's vote.

Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Validated
Assigned finding tags:

veRAACToken::recordVote lacks access control, allowing anyone to emit fake events

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.