Closed code423n4 closed 1 year ago
Seems invalid.
In all AMM functions base token reserve is checked, hence it would revert if token did not exist.
So yeah, creating a pair with wrong or malicious token is not an issue. It is also acknowledged in README.
berndartmueller marked the issue as duplicate of #245
Downgrading to QA (Low). Please see https://github.com/code-423n4/2022-12-caviar-findings/issues/245#issuecomment-1382854995 for my reasoning.
berndartmueller marked the issue as not a duplicate
berndartmueller changed the severity to QA (Quality Assurance)
berndartmueller marked the issue as grade-c
Lines of code
https://github.com/code-423n4/2022-12-caviar/blob/main/src/Caviar.sol#L37
Vulnerability details
Impact
solmate SafeTransferLib does not check the existence of code at token address. creating a pair using baseToken address that not exists, may lead to DoS the functionalities of the pair related to AMM.
Proof of Concept
How to reproduce:
All the next interaction with the contract using the following functions will revert:
PoC
Tools Used
manual review, foundry
Recommended Mitigation Steps
Before creating the pair check if baseToken address is a contract.