code-423n4 / 2022-01-livepeer-findings

0 stars 0 forks source link

LIP-73 contracts employ unsafe practice of unlocked pragma #245

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

hyh

Vulnerability details

Impact

As different compiler versions have critical behavior specifics if the contract gets accidentally deployed using another compiler version compared to one they tested with, various types of undesired behavior can be introduced.

Proof of Concept

LIP-73 contracts use unlocked pragma: pragma solidity ^0.8.0, allowing wide enough range of versions.

Example:

https://github.com/livepeer/arbitrum-lpt-bridge/blob/main/contracts/L2/pool/DelegatorPool.sol#L2

Recommended Mitigation Steps

Consider locking compiler version, for example pragma solidity 0.8.6.

This can have additional benefits, for example using custom errors to save gas and so forth.

yondonfu commented 2 years ago

Duplicate of https://github.com/code-423n4/2022-01-livepeer-findings/issues/47 and https://github.com/code-423n4/2022-01-livepeer-findings/issues/14