Skip to content

Unprotected getRate() call on Balancer pool

Description

The $VAR.getRate() call on a Balancer pool is not protected from the read-only reentrancy, which can lead to unintended behavior and potential security vulnerabilities.

Examples

Insecure Code

solidity
function example() {
  pool.getRate();
}

Secure Code

solidity
function example() {
  VaultReentrancyLib.ensureNotInVaultContext();
  pool.getRate();
}

Remediation

Add a reentrancy protection mechanism, such as VaultReentrancyLib.ensureNotInVaultContext(), before calling $VAR.getRate().

Rule Details

FieldValue
IDCODE-0105
CategoryInjection
SeverityHIGH
CWECWE-841
ConfidenceHIGH
ImpactHIGH
LikelihoodMEDIUM
ExploitabilityMODERATE
Tagsreentrancy, Balancer pool
OWASPN/A

References