re-al-Foundation / rwa-contracts

0 stars 0 forks source link

[RSE-02S] Inexistent Sanitization of Input Addresses #40

Closed chasebrownn closed 6 months ago

chasebrownn commented 6 months ago

RSE-02S: Inexistent Sanitization of Input Addresses

Type Severity Location
Input Sanitization RevenueStreamETH.sol:L105-L118

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(
    address _distributor,
    address _votingEscrow,
    address _admin
) external initializer {
    __Ownable_init(_admin);
    __UUPSUpgradeable_init();

    votingEscrow = _votingEscrow;
    revenueDistributor = _distributor;

    timeUntilExpired = 6 * (30 days); // 6 months to claim before expired
    cycles.push(block.timestamp);
}

Recommendation:

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