MorpheusAI

MorpheusAI
Foundry
22,500 USDC
View results
Submission Details
Severity: high
Invalid

L2MessageReceiver::_nonblockingLzReceive could allow minting to zero address if some special tokens are used

Summary

L2MessageReceiver::_nonblockingLzReceive doesnt have checks to prevent minting to zero address assuming this check will be performed by rewardToken, however some tokens dont perform this check leading to token burning

Vulnerability Details

L2MessageReceiver::_nonblockingLzReceive doesnt check for user != zero address, so, if some token like DAI is used as rewardToken then will lead to token burning

function _nonblockingLzReceive(
uint16 senderChainId_,
bytes memory senderAndReceiverAddresses_,
bytes memory payload_
) private {
//...
(address user_, uint256 amount_) = abi.decode(payload_, (address, uint256));
IMOR(rewardToken).mint(user_, amount_);
}

Dai minting code:

//https://raw.githubusercontent.com/makerdao/dss/master/src/dai.sol
function mint(address usr, uint wad) external auth {
balanceOf[usr] = add(balanceOf[usr], wad);
totalSupply = add(totalSupply, wad);
emit Transfer(address(0), usr, wad);
}

Leading to token burning

Impact

Token burning
Bad balance accounting

Tools Used

Manual review

Recommendations

Implement a zero address check on user parameter

function _nonblockingLzReceive(
uint16 senderChainId_,
bytes memory senderAndReceiverAddresses_,
bytes memory payload_
) private {
//...
(address user_, uint256 amount_) = abi.decode(payload_, (address, uint256));
require(user_ != address(0), "L1S: invalid user_");
IMOR(rewardToken).mint(user_, amount_);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge
over 1 year ago
inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.