Sense Finance Access Control Vulnerability

From Quadriga Initiative Cryptocurrency Hacks, Scams, and Frauds Repository
Jump to navigation Jump to search

Notice: This page is a freshly imported case study from the original repository. The original content was in a different format, and may not have relevant information for all sections. Please help restructure the content by moving information from the 'About' section to other sections, and add any missing information or sources you can find. If you are new here, please read General Tutorial on Wikis or Anatomy of a Case Study for help getting started.

Notice: This page contains sources which are not attributed to any text. The unattributed sources follow the initial description. Please assist by visiting each source, reviewing the content, and placing that reference next to any text it can be used to support. Feel free to add any information that you come across which isn't present already. Sources which don't contain any relevant information can be removed. Broken links can be replaced with versions from the Internet Archive. See General Tutorial on Wikis, Anatomy of a Case Study, and/or Citing Your Sources Guide for additional information. Thanks for your help!

Sense Finance Logo/Homepage

Sense Finance offers investors the ability to earn a small predictable return on their investments. Unfortunately, a vulnerability was introduced into the protocol during development, which could have allowed an attacker to take funds from the smart contract. Violet Vienhage, the whitehack who found and reported the vulnerability, was rewarded with a $50k bounty.

This is a global/international case not involving a specific country.[1][2][3][4][5][6][7][8]

About Sense Finance

"Adding Dimension to DeFi Earn predictable returns Earn a boosted yield Profit from interest rate movements"

"Sense operate[d] as decentralized, permissionless infrastructure, where teams [could] build and develop new yield primitives for DeFi, such as bond-like assets, yield tokens, and tranche-like instruments. Yield-stripping [was] the first application built on Sense, where users [could] lend at a fixed rate and make capital-efficient long/short bets on the future yields of existing yield-bearing assets."

"Sense is decentralized permissionless infrastructure, where teams can build and develop new yield primitives for DeFi, such as fixed income tokens, yield tokens, and other custom re-divisions of existing tokens' exposures."

"Stripping is the first application built atop Sense, where users can 1) access fixed rate versions of existing variable yield tokens or 2) make directional long/short bets on the future yields of existing yield-bearing assets."

"Sense works by breaking down a variable yield-bearing asset (a "Target") into two fixed term assets: a Principal Token (PT) and a Yield Token (YT). PTs & YTs trade on Sense Space, a high-yielding custom AMM."

"Security is our highest priority at Sense. The Sense Protocol has undergone various forms of quality assurance, such as unit/integration/manual testing, fuzz testing, and multiple 3rd party audits."

"On April 22, whitehat Violet Vienhage submitted a critical vulnerability in Sense Finance via Immunefi."

"We immediately paused the Sense Fuse Pool, the main consumer of the oracle, and followed up with an announcement of the bug on our discord." "Users can continue to safely earn fixed rates, go long/short future yields, and provide liquidity on Sense Space. Borrowing & Lending on the Sense Fuse Pool has been halted until further notice."

"A user could manipulate the oracle data at the most recent timestamp for a given Space pool by sending dummy swaps, incurring only the gas costs associated with the transaction. An attacker could do this every x minutes and drive the TWAP of the Space pool in whichever direction they’d like."

"Prior to adding the oracle to our Balancer Pool, the onSwap (Space.sol#L325) the function did not mutate any storage slots. As a result, the onlyVault (Space.sol#L807) modifier we use for the joins and exits — which makes it so that only the Balancer Vault can call those functions — was not used for our swap function. This was a deliberate omission since we were using onSwap as a preview function elsewhere in our codebase. ie, we were using it to check how much out we’d get for a given amount in, or vice versa, before actually executing the swap.

Unfortunately, we didn’t catch that when we added the oracle component later in our dev cycle for v1, there was now a storage slot mutation that shouldn’t have been accessible without actually performing a swap. Namely, updating the Space oracle price buffer should only happen when there’s a valid swap involving transferred tokens, but because an actual swap only actually takes place if onSwap is called through the Balancer V2 Vault, one could corrupt the oracle date by calling it directly as a “preview” function with garbage swap data."

"Sense Finance has paid the full $50,000 bounty listed on our ImmuneFi Bug Bounty Program and has already deployed a fix to mainnet."

"After 18 months of operation, we’ve made the decision to sunset the Sense Protocol and open-source the UI for community use."

"The Sense Core team will cease contributions to the current and future versions of the Sense Protocol. Despite our enduring belief in fixed income, the current DeFi market landscape lacks the consistent demand for fixed rates essential for robust market development."

This is a global/international case not involving a specific country.

The background of the exchange platform, service, or individuals involved, as it would have been seen or understood at the time of the events.

Include:

  • Known history of when and how the service was started.
  • What problems does the company or service claim to solve?
  • What marketing materials were used by the firm or business?
  • Audits performed, and excerpts that may have been included.
  • Business registration documents shown (fake or legitimate).
  • How were people recruited to participate?
  • Public warnings and announcements prior to the event.

Don't Include:

  • Any wording which directly states or implies that the business is/was illegitimate, or that a vulnerability existed.
  • Anything that wasn't reasonably knowable at the time of the event.

There could be more than one section here. If the same platform is involved with multiple incidents, then it can be linked to a main article page.

The Reality

This sections is included if a case involved deception or information that was unknown at the time. Examples include:

  • When the service was actually started (if different than the "official story").
  • Who actually ran a service and their own personal history.
  • How the service was structured behind the scenes. (For example, there was no "trading bot".)
  • Details of what audits reported and how vulnerabilities were missed during auditing.

What Happened

The specific events of the loss and how it came about. What actually happened to cause the loss and some of the events leading up to it.

Key Event Timeline - Sense Finance Access Control Vulnerability
Date Event Description
April 22nd, 2022 Violet Vienhage Report Vielet Vienhage reports details about the exploit to Immunefi.
June 9th, 2022 11:50:06 AM MDT Fix Disclosure Report
June 23rd, 2022 8:40:42 AM MDT Bugfix Review Post Sense Finance posts a review post which outlines the details of the exploit which has been resolved.
October 26th, 2023 10:17:27 AM MDT Sunset Of Project Sense Finance announces that the project is being sunset due to a lack of demand.

Technical Details

This section includes specific detailed technical analysis of any security breaches which happened. What specific software vulnerabilities contributed to the problem and how were they exploited?

Total Amount Lost

No funds were lost.

How much was lost and how was it calculated? If there are conflicting reports, which are accurate and where does the discrepancy lie?

Immediate Reactions

How did the various parties involved (firm, platform, management, and/or affected individual(s)) deal with the events? Were services shut down? Were announcements made? Were groups formed?

Ultimate Outcome

What was the end result? Was any investigation done? Were any individuals prosecuted? Was there a lawsuit? Was any tracing done?

A bounty of $50,000 USD was paid for the discovery.

Total Amount Recovered

There do not appear to have been any funds recovered in this case.

What funds were recovered? What funds were reimbursed for those affected users?

Ongoing Developments

What parts of this case are still remaining to be concluded?

Individual Prevention Policies

No specific policies for individual prevention have yet been identified in this case.

For the full list of how to protect your funds as an individual, check our Prevention Policies for Individuals guide.

Platform Prevention Policies

Policies for platforms to take to prevent this situation have not yet been selected in this case.

For the full list of how to protect your funds as a financial service, check our Prevention Policies for Platforms guide.

Regulatory Prevention Policies

No specific regulatory policies have yet been identified in this case.

For the full list of regulatory policies that can prevent loss, check our Prevention Policies for Regulators guide.

References