Incorrect operator used in deploySynth() of Pools.sol
The deploySynth() function in Pools.sol used a logical OR instead of AND in a require statement, so the check that the token is neither VADER nor USDV could be bypassed. An attacker could deploy VADER or USDV as a Synth, breaking protocol assumptions and potentially causing loss of funds.
Vader Protocol contest
Originally disclosed on Code4rena
The deploySynth() function in Pools.sol is expected to perform a check on the token parameter to determine that it is neither VADER or USDV before calling Factory’s deploySynth() function.
However, the require() incorrectly uses the ‘||’ operator instead of ‘&&’ which allows both VADER and USDV to be supplied as the token parameters. This will allow an attacker to deploy either VADER or USDV as a Synth which will break assumptions throughout the entire protocol. Protocol will break and funds may be lost.
Recommend changing ‘||’ operator to ‘&&’ in the require statement: require(token != VADER && token != USDV);
strictly-scarce (vader) addressed:
Duplicate https://github.com/code-423n4/2021-04-vader-findings/issues/21
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a simple coding mistake where the logical OR operator was used instead of AND in a require statement, inverting the intended check.
Impact
An attacker could deploy VADER or USDV as a Synth, which would break assumptions throughout the protocol and may lead to loss of funds.
What the attacker needed
Ability to call deploySynth()
The fix
The operator in the require statement should be changed from OR to AND, and the report indicates this was addressed.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Smart contracts often use require statements to check conditions before continuing. Here, the condition was meant to ensure a token is not VADER and not USDV, but because the wrong logical operator was used, the check passed if either one was true, allowing forbidden tokens. This could let someone create a Synth with a token that should never be allowed, which might disrupt the system.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.