Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unvalidated Token and Pricefeed Addresses: A Risk to Smart Contract Functionality #1091

Open
codehawks-bot opened this issue Aug 5, 2023 · 0 comments

Comments

@codehawks-bot
Copy link

Unvalidated Token and Pricefeed Addresses: A Risk to Smart Contract Functionality

Severity

Medium Risk

Relevant GitHub Links

https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/main/src/DSCEngine.sol#L112-L123

Summary

Constructor does not check if addresses are valid, only if the length of tokenAddresses and priceFeedAddresses is the same.

Vulnerability Details

Setting an invalid address either for tokenAddresses or priceFeedAddresses will pass silently as long as there are the same amount on both arrays but will leave the contract unusable since the constructor is not doing any other checks.

Impact

some Pricefeeds and tokenAddresses will be unusable since they are not valid

Tools Used

Manual review

Recommendations

add some checks at the constructor at least to see if not zero or the true tokens or price tokens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants