A potential vulnerability has been identified in the createContingentPool
function of the DIVA Protocol, where pool IDs (_poolId
) may collide if users provide identical pool parameters. This could lead to unintended behavior, such as pool duplication, replay attacks, or failure to distinguish between different pools.
The function IDIVA(_diva).createContingentPool
generates a pool ID (_poolId
) based on the provided PoolParams
structure. If the pool ID derivation mechanism does not incorporate a unique component—such as a nonce, sender address (msg.sender
), or timestamp—two calls with the same parameters will yield the same _poolId
. This results in a collision, which can cause:
Pool duplication: Multiple users attempting to create a pool with identical parameters may inadvertently reference the same pool.
Replay attacks: An attacker could reuse the same input parameters to recreate an existing pool, potentially affecting user expectations or protocol integrity.
Potential loss of funds or misrouting: If certain operations depend on unique pools, a collision could result in misallocation of collateral or incorrect settlement processes.
Loss of Pool Uniqueness: Different users creating the same pool parameters may unintentionally interact with the same pool.
Replayability: Malicious actors could exploit deterministic ID generation to manipulate protocol behavior.
Data Integrity Issues: If protocol logic assumes unique _poolId
values, collisions may lead to incorrect data mappings or state inconsistencies.
Manual Review
Incorporate Uniqueness in Pool ID Generation: Ensure that IDIVA.createContingentPool
includes a unique identifier, such as:
msg.sender
(to tie pools to the creator).
A nonce or counter (to guarantee unique increments).
Block timestamp (block.timestamp
) or a random salt.
Verify Uniqueness Before Pool Creation: Implement checks to confirm that a pool with the same parameters does not already exist unless intentional.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.