Era

ZKsync
FoundryLayer 2
500,000 USDC
View results
Submission Details
Severity: medium
Valid

Usage of `_token.approve` and `success` check on `L1ERC20Bridge` will revert for tokens that do not return a boolean value on approval

Summary

The _approveFundsToAssetRouter from L1ERC20Bridge.sol function uses _token.approve and checks the success value. This approach will revert for tokens that do not return a boolean value on approval.

Vulnerability Details

Some ERC20 tokens do not return a boolean value on the approve function, such as USDT. The current implementation of L1ERC20Bridge assumes that the approve function will always return a boolean value, which can lead to unexpected reverts.

Impact

The function will revert for tokens that do not return a boolean value on the approve function, causing a denial of service in L1ERC20Bridge.deposit for those tokens.

Tools Used

Manual review.

Recommendations

Use SafeERC20.forceApprove from OpenZeppelin to correctly handle tokens that do not return boolean values on approve.

Updates

Lead Judging Commences

inallhonesty Lead Judge 6 months ago
Submission Judgement Published
Validated
Assigned finding tags:

`L1ERC20Bridge` Uses Unsafe Approvals - USDT won't work

Support

FAQs

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