Skip to content

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

Closed
@Bitcex

Description

@Bitcex

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions