QuantAMM

QuantAMM
49,600 OP
View results
Submission Details
Severity: medium
Invalid

Missing Factory Validation in onRegister

01. Relevant GitHub Links

02. Summary

The onRegister function in the UpliftOnlyExample contract does not validate whether the pool being registered originates from a trusted (or “allowed”) factory. This omission enables any arbitrary pool—potentially malicious—to be registered, contradicting Balancer’s recommended security pattern that checks for factory authenticity when hooking into existing pool types.

03. Vulnerability Details

According to the Balancer v3 documentation, onRegister should verify two conditions:

  1. That the factory address is the one expected (factory == _allowedFactory).

  2. That the factory actually created the pool (IBasePoolFactory(factory).isPoolFromFactory(pool)).

For example, Balancer’s sample implementation is:

return factory == _allowedFactory && IBasePoolFactory(factory).isPoolFromFactory(pool);

However, in UpliftOnlyExample.sol, there is no such check:

function onRegister(
address,
address pool,
TokenConfig[] memory,
LiquidityManagement calldata liquidityManagement
) public override onlyVault returns (bool) {
...
return true;
}

Without verifying the pool and factory, attackers could register untrusted pools that might contain malicious logic or fail other security checks, thus exposing users and assets to unexpected behaviors or loss.

04. Impact

  • Exposure to Malicious Pools: Users might unknowingly interact with pools that have been registered through an untrusted factory.

  • Bypass of Balancer Security Practices: The standard Balancer approach is bypassed, undermining the intended safety of hooking into only vetted pool implementations.

  • Potential for Unrestricted Feature Use: Since the hooks expect to rely on the pool’s donation/unbalanced liquidity checks, skipping factory validation opens up the possibility for unintended or malicious features to be utilized without detection.

05. Tools Used

Manual Code Review and Foundry

06. Recommended Mitigation

  • Implement Factory Verification:

Add checks to onRegister similar to the Balancer v3 example. For example:

+ require(factory == _allowedFactory, "Factory not allowed");
+ require(IBasePoolFactory(factory).isPoolFromFactory(pool), "Not created by the factory");
Updates

Lead Judging Commences

n0kto Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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

Give us feedback!