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

bug; Unchecked External Call in setStorageRegistry in src/IdGateway.sol #440

Open
Bitcex opened this issue Oct 22, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@Bitcex
Copy link

Bitcex commented Oct 22, 2024

What is the bug?
In the setStorageRegistry function, the contract updates the storageRegistry address without performing a validity check (i.e., whether the _storageRegistry address is a valid contract implementing the IStorageRegistry interface). If a non-contract address or a contract with a different interface is passed, this could lead to undefined behavior or loss of functionality.

fix: Add a check to ensure _storageRegistry is a valid contract that supports the IStorageRegistry interface using this.

require(Address.isContract(_storageRegistry), "Not a valid contract");

Nb: Adding this check improves contract robustness and prevents the contract from breaking due to incorrect registry addresses.

@Bitcex Bitcex added the bug Something isn't working label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants