re-al-Foundation / rwa-contracts

Core dev environment for the RWA Governance contracts
0 stars 0 forks source link

[RRR-02S] Inexistent Sanitization of Input Addresses #34

Closed chasebrownn closed 7 months ago

chasebrownn commented 7 months ago

RRR-02S: Inexistent Sanitization of Input Addresses

Type Severity Location
Input Sanitization RealReceiver.sol:L91-L104

Description:

The linked function(s) accept address arguments yet do not properly sanitize them.

Impact:

The presence of zero-value addresses, especially in constructor implementations, can cause the contract to be permanently inoperable. These checks are advised as zero-value inputs are a common side-effect of off-chain software related bugs.

Example:

function initialize(
    uint16 _srcChainId,
    address _veRwaNFT,
    address _rwaToken,
    address _admin
) external initializer {
    __Ownable_init(_admin);
    __NonblockingLzApp_init(_admin);
    __UUPSUpgradeable_init();

    veRwaNFT = _veRwaNFT;
    rwaToken = _rwaToken;
    srcChainId = _srcChainId;
}

Recommendation:

We advise some basic sanitization to be put in place by ensuring that each address specified is non-zero.