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
| Field | Value |
|---|---|
| ID | CODE-0105 |
| Category | Injection |
| Severity | HIGH |
| CWE | CWE-841 |
| Confidence | HIGH |
| Impact | HIGH |
| Likelihood | MEDIUM |
| Exploitability | MODERATE |
| Tags | reentrancy, Balancer pool |
| OWASP | N/A |