code-423n4 / 2022-02-skale-findings

0 stars 0 forks source link

QA Report #81

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Lines of code

https://github.com/skalenetwork/ima-c4-audit/blob/main/contracts/schain/CommunityLocker.sol#L209-L231

Vulnerability details

Impact

The setGasPrice() function is used to configure the mainnetGasPrice and gasPriceTimestamp on the relevant Schain. While the function would typically perform proper BLS signature verification, this has been commented out and hence any user can call this function to configure the values to any arbitrary amount.

Proof of Concept

Tools Used

Manual code review.

Recommended Mitigation Steps

Consider performing the necessary signature verification on this function.

cstrangedk commented 2 years ago

Duplicate of #21 and #80

There is no computation that currently uses mainnetGas price, if you search all contracts you will find no other reference to use this variable. This is a TODO stub, which will be finished and implemented when the Oracle is complete - at which the BLS threshold signature from the nodes will be required to be verified to set the MainnetGasPrice.

GalloDaSballo commented 2 years ago

Per the sponsor reply, and the fact that the function isn't used for computation, I will downgrade to non-critical

JeeberC4 commented 2 years ago

Creating QA Report for warden as judge downgraded issue. Preserving original title: setGasPrice() Can be Called by Anyone