code-423n4 / 2023-10-wildcat-findings

12 stars 9 forks source link

Uninitialized State Variables #690

Closed c4-submissions closed 10 months ago

c4-submissions commented 10 months ago

Lines of code

https://github.com/code-423n4/2023-10-wildcat/blob/c5df665f0bc2ca5df6f06938d66494b11e7bdada/src/WildcatMarketController.sol#L255-L268

Vulnerability details

Impact

in The _resetTmpMarketParameters function is an internal function, which means it can only be called from within the WildcatMarketController contract itself. If a child contract inherits from WildcatMarketController and calls _resetTmpMarketParameters before _tmpMarketParameters is initialized, it could indeed lead to unexpected behavior. The _resetTmpMarketParameters() function resets the _tmpMarketParameters struct to its default state. If a child contract calls this function before _tmpMarketParameters is initialized, it will overwrite the _tmpMarketParameters struct with the default values, which could disrupt the logic of the parent contract.

Proof of Concept

Attack Vector:

Tools Used

manual review

Recommended Mitigation Steps

ensure that _tmpMarketParameters is always properly initialized before it's used.

Assessed type

Other

c4-pre-sort commented 10 months ago

minhquanym marked the issue as low quality report

minhquanym commented 10 months ago

QA

c4-judge commented 10 months ago

MarioPoneder marked the issue as unsatisfactory: Insufficient quality