sherlock-audit / 2024-10-ethos-network-judging

0 stars 0 forks source link

0xBhumii - `Compromised Address` Voting in `EthosVote` Contract leading to damage of user reputation #286

Open sherlock-admin2 opened 2 weeks ago

sherlock-admin2 commented 2 weeks ago

0xBhumii

Medium

Compromised Address Voting in EthosVote Contract leading to damage of user reputation

Summary

The EthosVote contract allows an attacker to cast votes using a compromised address linked to a user's profile, potentially damaging the user's reputation and credibility within the Ethos ecosystem. This occurs because the voteFor function does not verify if the address is compromised when checking for a valid profile.

Root Cause

In EthosVote.sol, the voteFor function calls verifiedProfileIdForAddress from the EthosProfile contract without checking if the address is compromised. As a result, a compromised address can be used to cast votes, affecting the overall integrity of the voting system. https://github.com/sherlock-audit/2024-10-ethos-network/blob/main/ethos/packages/contracts/contracts/EthosVote.sol#L137C3-L156C4

Internal pre-conditions

  1. The attacker's address must be able to call voteFor with a target contract and target ID.
  2. The compromised address must have a verified profile ID.
  3. The vote can be cast as either an upvote or a downvote.

External pre-conditions

  1. The compromised address is verified within the EthosProfile contract.
  2. No mechanism exists in the EthosVote contract to check the compromised status of an address during the voting process.

Attack Path

  1. An attacker compromises a user's address associated with a verified Ethos profile.
  2. The attacker calls the voteFor function using the compromised address, specifying a target contract and target ID.
  3. The contract verifies the user's profile ID without checking the compromised status.
  4. The vote is successfully cast, either as an upvote or downvote, thereby affecting the reputation and credibility of the legitimate user.

Impact

The affected party, namely the user whose address was compromised, suffers reputational damage due to unauthorized voting actions that misrepresent their opinions. This could lead to distrust within the community and potential loss of engagement with the platform. The attacker gains the ability to influence outcomes without consent or accountability.

PoC

No response

Mitigation

To prevent this vulnerability, the voteFor function should include a check for the compromised status of the address before allowing it to cast a vote