Core Contracts

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

Unauthorized Vote Casting Vulnerability

Summary

The recordVote function allows recording a vote for a given proposal. However, it lacks a restriction ensuring that only the voter themselves can cast their vote. This opens a potential vulnerability where a malicious user could call this function on behalf of another user, potentially influencing the voting process unfairly.

Affected Function

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);
}

Issue Description

  • The function does not include an access control mechanism to verify that msg.sender is the actual voter.

  • A malicious actor could execute this function and pass any address as the voter, effectively forcing other users to vote on a proposal without their consent.

Impact

  • Unauthorized voting could manipulate governance decisions.

  • Users may unknowingly have their votes cast for proposals they do not support.

  • The integrity of the voting process is compromised.

Recommendation

Add a check to ensure that only the voter themselves can call this function by verifying msg.sender:

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

This modification ensures that only the voter (the caller of the function) can cast their own vote, preventing unauthorized voting.

Updates

Lead Judging Commences

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

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

inallhonesty Lead Judge 10 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.

Give us feedback!