Skip to content
Access control Write-up Intermediate

Sense Finance Access Control Issue Bug Fix Review

The onSwap() function in the Sense Balancer pool lacked access control, allowing anyone to call it directly and supply arbitrary price and reserve data to the oracle. This could let an attacker manipulate the oracle price and timestamp, potentially enabling theft of collateral from Rari Fuse pools that relied on the oracle.

immunefi.com

Published on immunefi.com

On April 22, whitehat Reptile71590 submitted a critical vulnerability in Sense Finance via Immunefi. Sense operates as decentralized, permissionless infrastructure, where teams can build and develop new yield primitives for DeFi, such as bond-like assets, yield tokens, and tranche-like instruments.

The author, on immunefi.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The onSwap() function lacked the onlyVault() modifier that was present on other callback functions, so it did not verify that the caller was the Balancer vault.

Impact

The vulnerability could have allowed a malicious actor to perform theft of any borrowable collateral provided to the Rari pools, and the theft of any assets of the users which have been borrowed against, by manipulating the oracle price and timestamp; however, the pools relying on the oracle were paused upon disclosure, so there were no assets at risk.

What the attacker needed

Ability to call onSwap() directly; pools relying on the oracle are active

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

An oracle is a service that provides price data to a smart contract. In this case, the pool contract had a function that updated the oracle, but it did not check who was calling it. That meant anyone could call it and feed fake prices, which could then be used to steal money from other contracts that trusted those prices.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.