Skip to content

Latest commit

 

History

History
37 lines (19 loc) · 1.71 KB

File metadata and controls

37 lines (19 loc) · 1.71 KB

Active Taffy Hornet

Medium

M-1:Usage of abi.encodePacked can lead to hash collisions

Summary

The hash is being created using abi.encodePacked at EthosAttestation::_keccakForCreateAttestation and EthosAttestation::getServiceAndAccountHash which contains dynamic type variables such as string and bytes. This can potentially lead to a hash collision due to the nature of encodePacked, which omits padding for more compact encoding. This increases the likelihood of hash collisions because different input values might result in the same packed output.

Root Cause

In EthosAttestation.sol:435 and EthosAttestation.sol:528, the abi.encodePacked is packing dynamic types such as string and bytes.

Internal pre-conditions

  1. A user needs to be verified in order to create attestation.

External pre-conditions

No response

Attack Path

  1. User calls the createAttestation with values which are susceptible to hash collisions.

Impact

A genuine user will have his attestation creation denied even though the inputs being different from the ones of previous signature.

PoC

No response

Mitigation

Consider using abi.encode to mitigate this issue.