Lucene search

K
code423n4Code4renaCODE423N4:2022-10-THEGRAPH-FINDINGS-ISSUES-314
HistoryOct 12, 2022 - 12:00 a.m.

Missing 0 check can lead to unexpected behaviors

2022-10-1200:00:00
Code4rena
github.com
3
vulnerability checks setters
zero address
github permalinks
mitigation

Lines of code
<https://github.com/code-423n4/2022-10-thegraph/blob/7ea88cc41f17f2d49961aafec7ebe72daeaad3f9/contracts/governance/Governed.sol#L31-L33&gt;
<https://github.com/code-423n4/2022-10-thegraph/blob/7ea88cc41f17f2d49961aafec7ebe72daeaad3f9/contracts/governance/Pausable.sol#L55-L59&gt;

Vulnerability details

Missing checks for address(0x0) on setters can lead to problems

Impact

User roles can being set to wrong values that block functionalities

Summary

Zero address should be checked for state variables, immutable variables. A zero address can lead into problems.

##Github Permalinks
<https://github.com/code-423n4/2022-10-thegraph/blob/7ea88cc41f17f2d49961aafec7ebe72daeaad3f9/contracts/governance/Governed.sol#L31-L33&gt;
<https://github.com/code-423n4/2022-10-thegraph/blob/7ea88cc41f17f2d49961aafec7ebe72daeaad3f9/contracts/governance/Pausable.sol#L55-L59&gt;

Mitigation

Check zero address before assigning or using it


The text was updated successfully, but these errors were encountered:

šŸ‘Ž 1 Minh-Trng reacted with thumbs down emoji

All reactions

  • šŸ‘Ž 1 reaction