The Bridge contract could allow unauthorized token deposits, effectively bypassing the whitelist mechanism due to a flaw in _isWhiteListed function.
This vulnerability stems from an incorrect implementation of the _isWhiteListed
function, which is crucial for enforcing the whitelist restrictions.
This implementation has a logical flaw:
When _whiteListEnabled
is false
, the function always returns true
, regardless of whether the collection is in the whitelist or not.
This means that when the whitelist feature is disabled, all collections are considered whitelisted, which is contrary to the intended security model.
Here is a quick test in Remix IDE to show the flaw in the function. Paste the below code into Remix and pass in any address as the collection address:
The function would always return "true" even if the collection address passed in the parameter is never whitelisted.
The depositTokens
function, which is responsible for initiating token deposits into the bridge, checks the whitelist status using this flawed function:
Due to the bug in _isWhiteListed
, this check can be bypassed when the whitelist is disabled, allowing any collection to be deposited into the bridge.
Proof of Concept:
Set _whiteListEnabled
to false
using the enableWhiteList
function.
Attempt to deposit tokens from a non-whitelisted collection using the depositTokens
function.
The deposit will succeed, bypassing the intended whitelist check.
Fake collections can be deposited into the bridge named Everai NFT collection when the whitelist is disabled.
Malicious actors can deposit tokens from unauthorized or harmful collections into the bridge when the whitelist is disabled.
Manual review
Modify the _isWhiteListed
function to correctly implement the whitelist logic:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.