Restricted addresses are still able to use Zetachain due to faulty update
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2025-04-zetachain-cross-chain-judging/issues/79
Found by
0x73696d616f
Summary
Zetachain has a restricted address list that stops inbounds from going through, link.
However, the restricted addresses book is not correctly set when it is updated later in a config file. Here a watcher is set to update the list when the file is updated. config.go::loadRestrictedAddressesConfig() is called with the old config and the file to update the addresses list from.
config.go::loadRestrictedAddressesConfig() shows that the new addresses fetched from the file are never used, and the old config is used to set the restricted addresses, confirming that these addresses are not updated.
func loadRestrictedAddressesConfig(cfg Config, file string) error {
input, err := os.ReadFile(file) // #nosec G304
if err != nil {
return errors.Wrapf(err, "reading file %s", file)
}
addresses := []string{}
err = json.Unmarshal(input, &addresses)
if err != nil {
return errors.Wrap(err, "invalid json")
}
restrictedAddressBookLock.Lock()
defer restrictedAddressBookLock.Unlock()
// Clear the existing map, load addresses from main config, then load addresses
// from dedicated config file
SetRestrictedAddressesFromConfig(cfg)
for _, addr := range cfg.ComplianceConfig.RestrictedAddresses {
restrictedAddressBook[strings.ToLower(addr)] = true
}
return nil
}
This will lead to catastrophic consequences as an attacker will not be blacklisted when they should and is able to exploit Zetachain how much they want. Essentially, this renders the blacklist mechanism useless and access control can be circumvented.
Root Cause
In node/zetaclient/config/config.go:111, the new restricted addresses from the file are not used.
Internal Pre-conditions
None.
External Pre-conditions
None.
Attack Path
- User is restricted by changing the config file by the nodes, but it won't apply and the user will not be blacklisted.
Impact
Attacker can circumvent restricted address access control and keep using the SUI/EVM gateways.
PoC
See above.
Mitigation
Iterate through the new addresses fetched from the file to set the restrictedAddressBook map instead of using the old, stale config.
Discussion
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/zeta-chain/node/pull/3971
gjaldon
The restricted addresses from the loaded file are now being used.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is known
A medium-severity access control bug in ZetaChain Cross-Chain. Sherlock made it public on 28 May 2025. Found in the 857 audit contest (finding M-4).
About Access control
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.