FoundrySolidityLayer 2
7.25 ETH
Submission Details
Impact: high
Likelihood: low

Agreements can be permanently DOS'd from creating Confidence Pools

Author Revealed upon completion

Root + Impact

AgreementFactory address can be changed in BattleChainSafeHarborRegistry, DOSing all the previous valid agreements created from using createPool(...)

Description

The createPool(...) function calls safeHarborRegistry.isAgreementValid() to check if an agreement address is valid. This functions calls the AgreementFactory to check the agreement's validity.

function isAgreementValid(address agreementAddress) external view returns (bool) {
if (s_agreementFactory == address(0)) {
return false;
}
return IAgreementFactory(s_agreementFactory).isAgreementContract(agreementAddress);
}

The AgreementFactory address in the BattleChainSafeHarborRegistry contract can change through the setAgreementFactory(...) function. This means that valid agreements, that possibly already have created Confidence Pools, cannot use createPool(...).

function setAgreementFactory(address factory) external onlyOwner {
if (factory == address(0)) {
revert BattleChainSafeHarborRegistry__ZeroAddress();
}
emit AgreementFactorySet(factory);
s_agreementFactory = factory;
}

Risk

Likelihood:

When AgreementFactory address will be changed

Impact:

Valid agreements can't create Confidence Pools

Proof of Concept

Recommended Mitigation

Consider allowing agreements that have already deployed a Confidence Pool to be able to create more, regardless their validity.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!