President Elector

First Flight #24
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: high
Invalid

Missing DOMAIN_SEPARATOR Getter

Summary

The RankedChoiceVoting contract is designed to allow voters to sign off-chain transactions that can be used to submit their votes on-chain through the rankCandidatesBySig function. However, the contract lacks a DOMAIN_SEPARATOR getter. This is problematic because it impedes the ability of users to sign and verify transactions off-chain, which is crucial for the functionality of rankCandidatesBySig.

Vulnerability Details

The DOMAIN_SEPARATOR is a crucial component of the EIP-712 standard used for off-chain signing and on-chain verification. The DOMAIN_SEPARATOR is used in the signature verification process to ensure that the signed data is tied to a specific domain. In the rankCandidatesBySig function, the DOMAIN_SEPARATOR is used to hash the data that is signed by the voters. Without a proper DOMAIN_SEPARATOR getter in the contract, users cannot correctly sign transactions that will be verified by the contract.

Impact

Off-Chain Signing: Users are unable to sign transactions that can be later used in rankCandidatesBySig, rendering the feature non-functional.

Functionality: The inability to retrieve or verify the DOMAIN_SEPARATOR will break the expected workflow for off-chain signing and on-chain submission of votes.

Security: Without proper DOMAIN_SEPARATOR handling, there is a risk of mismatched or incorrect signatures being used, potentially leading to incorrect voting or unauthorized access.

Tools Used

Manual Review

Recommendations

Implement DOMAIN_SEPARATOR Getter:

  • Add a public function to the RankedChoiceVoting contract that returns the DOMAIN_SEPARATOR. This function should match the EIP-712 domain separator specification.

  • Example Implementation:

    function DOMAIN_SEPARATOR() public view returns (bytes32) {
    return _domainSeparatorV4();
    }
Updates

Lead Judging Commences

inallhonesty Lead Judge 12 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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