<!-- canonical: https://0xsimao.com/findings/keyring-ii-blacklist-entity-unblacklist-addresses -->

# KeyringCoreV2Base::blacklistEntity() and KeyringCoreV2Base::unblacklistEntity() could check that the addresses are not already set

Low/Info · Three Sigma · Zero-knowledge compliance · 10th July, 2024

Finding 3S-Keyring-N02 of the Keyring Credentials security review.

- Protocol: https://www.keyring.network/
- Report: /reports/keyring-ii
- Source: https://cdn.sanity.io/files/qoqld077/production/75b68b74f4b0dc6fbcd94892d934547d8259b57a.pdf

---

### Description

KeyringCoreV2Base::blacklistEntity() and
KeyringCoreV2Base::unblacklistEntity() could perform additional checks such that
the address is not already blacklisted or not. It has no impact but could be important to warn
the admin about potential mistakes, as not reverting would likely go unnoticed.
Additionally, other permissioned functions such as KeyringCoreV2Base::registerKey()
or KeyringCoreV2Base::revokeKey() perform similar checks.

### Recommendation

Revert if the address is already blacklisted or not blacklisted.

### Status

Addressed in [#ffe8b11](https://github.com/Keyring-Network/core-v2/commit/ffe8b11b3c8b1eaadb1713eb19e80872a9d1c630).

---

Related findings:

- [OstiumLinkUpKeep:topUp() is missing a length check for registryAddresses](https://0xsimao.com/findings/ostium-link-top-registry-addresses): Ostium
- [Setting note commitments, nullifiers and note footers used should revert if they are already set to prevent exploits](https://0xsimao.com/findings/singularity-commitments-nullifiers-footers-revert): Singularity
- [StakingOperator::setCollateralToken() will cause issues if it changes tokens relations that have already been set](https://0xsimao.com/findings/singularity-staking-collateral-changes-relations): Singularity
- [BasicVaultFactory::createVault() inconsistent already existing vault check](https://0xsimao.com/findings/mitosis-create-inconsistent-already-existing): Mitosis
