Visor Finance Unlimited Minting
Notice: This page is a new case study and some aspects have not been fully researched. Some sections may be incomplete or reflect inaccuracies present in initial sources. Please check the References at the bottom for further information and perform your own additional assessment. Please feel free to contribute by adding any missing information or sources you come across. 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!
Due to a bug in the Visor Finance smart contract, an attacker was able to mint an unlimited number of VISR tokens. These were then sold on the open market. The Visor Finance project has merged with Gamma Strategies, and all affected users will be issued new GAMMA tokens.
About Visor Finance
"Visor Finance is a Uniswap based protocol that is specialized in NFT smart vaults for liquidity provisioning. It predicts the DeFi ecosystem where market conditions can unlock liquidity from networks of independent smart vaults."
"Visor allows DeFi participants to utilize NFT Smart Vaults for liquidity provisioning and active liquidity management on Uniswap v3." "Visor's community is thousands strong and is distributed across a variety of channels."
"As @uniswap v3 makes liquidity provision more complicated for the common man, @VisorFinance allows you to compete with professional liquidity providers by pooling peoples liquidity together and dynamically concentrating it around price to maximize returns for you."
The Reality
The Visor Finance smart contracts were unaudited.
What Happened
"It is the season of giving, and Visor Finance is going all in. Visor allowed an anonymous actor to mint $8.2M in VISR."
Date | Event | Description |
---|---|---|
December 21st, 2021 7:58:00 AM MST | Gamma Strategies Tweet | Gamma Strategies tweets to inform the community that they are aware of the "exploit of the vVISR staking contract and are impl[e]menting a migration plan for affected VISR"[7]. |
December 22nd, 2021 2:04:00 AM MST | Santa Hackathon Article | The Visor Finance hack is listed as the seventh attack in December by a cryptonews article[8]. The hack resulted in the loss of approximately $8.2 million worth of digital assets. The project's team confirmed the hack and stated that they would reimburse affected users. The attack drained Visor Finance's staking contract, involving over 8.8 million VISR tokens, valued at over $8 million at the time of the hack. The hacker had swapped most of the VISR tokens for Ethereum (ETH) on Uniswap and used Tornado Cash for privacy. However, due to token illiquidity, the hacker ended up with only around 200 ETH (approximately $812,000). Visor Finance plans to launch a new token with a different ticker and allow users to redeem it at a 1:1 ratio, listing it on various registries. As a result of the hack, VISR's value plummeted by 96% over 24 hours, trading at $0.038. |
December 22nd, 2021 2:20:26 AM MST | CoinGape Article Published | Following the exploit that led to the loss of 8.8 million VISR tokens and a subsequent 94% drop in the token's price, Visor Finance has decided to launch a new token to replace the stolen VISR. This decision was outlined in Visor's post-mortem report on the hack[5]. To prevent confusion, the new token will have a different ticker symbol from VISR. Visor Finance has initiated the listing process for the new token on various registries to ensure visibility and recognition by decentralized exchanges and wallets. Visor Finance plans to revise the flawed staking contract. Visor Finance has engaged with auditing firms Quantstamp and ConsenSys Diligence for audits in December and January, with the new staking contract included in the scope of these audits. |
December 22nd, 2021 2:46:45 AM MST | Yahoo Finance Article | FXEmpire reports that Visor Finance, a DeFi protocol, suffered a significant hack resulting in the loss of 8.8 million VISR tokens, valued at around $8.2 million at the time of the breach. The exploit was attributed to a reentrancy flaw that allowed hackers to manipulate the protocol's rewards contract and generate extra VISR tokens. The attack primarily impacted stakers and token holders, causing VISR's value to plummet by 95%. To compensate affected users, Visor Finance plans to conduct a token migration, allowing them to exchange their existing tokens for new ones based on a snapshot taken before the hack. Despite this incident, Visor Finance has previously faced breaches in 2021 and aims to improve security through ongoing audits. This news is shared through Yahoo Finance[9]. |
Technical Details
The hack primarily exploited flaws in the vVISR staking contract, allowing attackers to re-enter and mint additional vVISR tokens while enabling limitless minting to exacerbate the impact of the exploit. In response, Visor Finance plans to revise the flawed staking contract, ensuring it does not rely on a user-provided contract for the necessary transfer function. Instead, it will rely on a fixed transfer implementation like ERC20[5].
FXEmpire reports that Visor Finance, a DeFi protocol, suffered a significant hack resulting in the loss of 8.8 million VISR tokens, valued at around $8.2 million at the time of the breach. The exploit was attributed to a reentrancy flaw that allowed hackers to manipulate the protocol's rewards contract and generate extra VISR tokens. The attack primarily impacted stakers and token holders, causing VISR's value to plummet by 95%. To compensate affected users, Visor Finance plans to conduct a token migration, allowing them to exchange their existing tokens for new ones based on a snapshot taken before the hack. Despite this incident, Visor Finance has previously faced breaches in 2021 and aims to improve security through ongoing audits. This news is shared through Yahoo Finance[9].
The Visor Finance hack is listed as the seventh attack in December by a cryptonews article[8]. The hack resulted in the loss of approximately $8.2 million worth of digital assets. The project's team confirmed the hack and stated that they would reimburse affected users. The attack drained Visor Finance's staking contract, involving over 8.8 million VISR tokens, valued at over $8 million at the time of the hack. The hacker had swapped most of the VISR tokens for Ethereum (ETH) on Uniswap and used Tornado Cash for privacy. However, due to token illiquidity, the hacker ended up with only around 200 ETH (approximately $812,000). Visor Finance plans to launch a new token with a different ticker and allow users to redeem it at a 1:1 ratio, listing it on various registries. As a result of the hack, VISR's value plummeted by 96% over 24 hours, trading at $0.038.
"On December 21st 2021 02:29:11 PM UTC a malicious contract drained Visor Finance’s staking contract of 8,812,958 VISR tokens." "Hackers used the IVisor delegateTransferERC20 interface to generate the exploit. The hackers also used the withdrawal function of the staking contract to call for the desired VISR amount. As a result, reliance on an external IVisor delegateTransferERC20 implementation by the caller allowed the exploit to succeed."
"As long as the hacker passes their own contract as “from” and the contract has an Owner() method of msg.sender, then they can mint as many shares as they want to any address using vvisr.mint()."
"The attack was made possible by implementing the IVisor delegateTransferERC20 interface and calling the staking contract’s withdraw function with the desired VISR amount. Dependence on arbitrary IVisor delegateTransferERC20 implementation by caller allowed for the attack to take place."
"The staking contract should not rely on a user provided contract to implement the required transfer function. The staking contract should instead rely on a fixed transfer implementation such as ERC20.transferFrom."
"The attacker transferred ownership of the contract to its own address, before executing the exploit transaction, minting 195k vVISR tokens."
"These were then burned for 8.8M VISR before being swapped via Uniswap v2 for ETH and washed via Tornado Cash in 7 subsequent transactions totalling 113 ETH ($450k) so far."
Total Amount Lost
The total amount lost has been estimated at $8,200,000 USD.
Immediate Reactions
Gamma Strategies Tweet
Gamma Strategies posted a tweet to inform the community that they were aware of the smart contract exploit[7].
We are aware of an exploit of the vVISR staking contract and are impl[e]menting a migration plan for affected VISR. No positions or hypervisor's are at risk.
Visor Finance Price Plummetting
"Post exploit, VISR’s price witnessed a steep drop amounting to 94 percent. At press time, VISR was trading at the price of $0.054998, with a market cap that stood slightly over $1 million, according to CoinMarketCap data."
"We will only manage funds using contracts audited by tier one audit firms." "We are engaged with both Quantstamp and ConsenSys Diligence for December and January audits and this new staking contract will be included."
"Launching a new token that replaces the old one is confusing if the ticker stays the same. What we have opted to do is replace the old VISR token ticker symbol with the new one. All tokenomics will stay the same and there will be a redemption (from the time of the snapshot) of 1:1 with the new token, including those staked in the vVISR contract and the those staked in Tokemak. We have already begun the process of listing the new token on various registries in order to make sure the new token is visible and recognized by dexes and wallets starting day one. No one should buy VISR as it will not be redeemable for the new token."
Ultimate Outcome
Following the exploit that led to the loss of 8.8 million VISR tokens and a subsequent 94% drop in the token's price, Visor Finance has decided to launch a new token to replace the stolen VISR. This decision was outlined in Visor's post-mortem report on the hack[5].
To prevent confusion, the new token will have a different ticker symbol from VISR. Visor Finance has initiated the listing process for the new token on various registries to ensure visibility and recognition by decentralized exchanges and wallets. They have strongly advised against purchasing the old VISR, as it will not be redeemable for the replacement token[5].
Visor Finance has engaged with auditing firms Quantstamp and ConsenSys Diligence for audits in December and January, with the new staking contract included in the scope of these audits.[5]
"Since the initial grant from Visor in May 2021, Gamma’s team has worked closely with Visor and has made extraordinary progress on defining and becoming the leading active liquidity manager."
"For the past 6 months the Gamma team has worked on all the tooling necessary to interface with position management as well as develop active liquidity strategies managing $25M in TVL and 40+ pairs for both retail LP’s and projects. We have an incredible structure in place that allows us to execute on the most competitive aspect of active liquidity management: the strategies."
"In addition to managing all positions, Gamma also develops and maintains the Active Strategy Framework, Uniswap position discovery for Mainnet, and Optimism and various deployed strategies that are currently active across all pairs."
"Visor is merging with Gamma Strategies." "[W]e have reached unanimous agreement as two teams that the appropriate outcome is to merge the protocol, treasury and personnel with Gamma Strategies." "Tomorrow, Gamma will be providing liquidity for $GAMMA and will be distributing tokens to all VISR, vVISR and tVISR holders at time of snapshot (occurred December 21st)."
"GAMMA token has been minted and all tokens will be distributed to all VISR, vVISR and tVISR holders at time of snapshot within the next 24 hours." "The $GAMMA token has been distributed to all addresses and liquidity has been deployed to Uniswap v3 of identical amounts and price at the time of the snapshot."
Total Amount Recovered
Affected users of the Visor Protocol received GAMMA tokens as compensation for their loss.
TBD - Was this equivalent/satisfactory?
Ongoing Developments
TBD
Individual Prevention Policies
Visor Finance smart contracts were unaudited. Ensuring that smart contracts are audited, ideally by two or three reputable smart contract auditing services, would be highly likely to have caught issues such as this one. Unaudited smart contracts can often contain vulnerabilities which may be exploited and result in loss of funds.
Avoid the use of smart contracts unless necessary. Minimize the level of exposure by removing or withdrawing assets whenever possible. Aim to choose smart contracts which have obtained third party security audits, preferably having been audited by at least three separate reputable firms. Pay attention to the audit reports, which smart contracts are covered, and whether the smart contract has been upgraded or modified since the report. Ensure that any administrative functions with the ability to remove funds from the smart contract are under the authority of a multi-signature wallet which is controlled by at least three separate and reputable entities.
Funds which are stored offline and not connected to any smart contract are significantly more secure.
Store the majority of funds offline. By offline, it means that the private key and/or seed phrase is exclusively held by you and not connected to any networked device. Examples of offline storage include paper wallets (seed phrase or key written down and deleted from all electronic media), hardware wallets, steel wallet devices, etc...
For the full list of how to protect your funds as an individual, check our Prevention Policies for Individuals guide.
Platform Prevention Policies
The Visor Finance protocol contained an infinite mint exploit, which could very likely have been uncovered through an audit of the protocol. However, the protocol was never audited prior to the exploit.
All aspects of any platform should undergo a regular validation/inspection by experts. This validation should include a security audit of any smart contracts, reporting any risks to the backing (of any customer assets, ensuring treasuries or minting functions are properly secured under the control of a multi-signature wallet, and finding any inadequacies in the level of training or integrity of the team. The recommended interval is twice prior to launch or significant system upgrade, once after 3 months, and every 6 months thereafter. It is recommended that the third party performing the inspection not be repeated within a 14 month period.
In general, having complex smart contract hot wallets in charge of minting is risky. Instead, amounts under the control of the smart contract should be limited and larger mints should be the responsibility of a multi-sig wallet with keys securely held by trusted individuals.
All wallets, minting functions, and critical infrastructure should be implemented with a multi-signature requirement, with a recommended minimum of 3 signatures required. This means that making important changes or approving spending will require the keys held by at least 3 separate individuals within the organization to approve. The multi-signature should be implemented at the lowest layer possible, all key holders should have security training, and all key holders should be empowered and encouraged to exercise diligence.
In the event that protocols are breached, it is also important to have funds available to assist victims. While in this case, assistance came from the protocol, other situations may not compensate users. While assistance from an industry insurance fund is discretionary, and could be limited in cases where users used an unaudited smart contract, it would be able to assist quickly and prevent the devastation of a total capital loss.
Work with other industry platforms to set up a multi-signature wallet with private keys held separately by delegate signatories from seven prominent platforms and services within the industry. Establish requirements for contributions by all platforms and services, designed to be affordable for small platforms yet large enough to cover anticipated breach events. Any breach event can be brought forth by a member platform or a petition of 100 signatures for consideration by the delegate signatories. A vote of 4 or more delegate signatures is required to release any funds, which could partially or fully restore lost funds based on their assessment.
For the full list of how to protect your funds as a financial service, check our Prevention Policies for Platforms guide.
Regulatory Prevention Policies
The Visor Finance protocol contained an infinite mint exploit, which could very likely have been uncovered through an audit of the protocol. However, the protocol was never audited prior to the exploit. Standardizing audits of all services can help prevent similar exploits and losses.
All platforms should undergo published security and risk assessments by independent third parties. Two assessments are required at founding or major upgrade, one after 3 months, and one every 6 months thereafter. The third parties must not repeat within the past 14 months. A risk assessment needs to include what assets back customer deposits and the risk of default from any third parties being lent to. The security assessment must include ensuring a proper multi-signature wallet, and that all signatories are properly trained. Assessments must be performed on social media, databases, and DNS security.
Users should be educated to ensure that they are aware of the risks and will choose to use audited protocols.
Create a standard tutorial and quiz for all new cryptocurrency participants, which is required to be completed once per participant. This tutorial and quiz should cover the basics of proper seed phrase protection, strong password generation, secure two-factor authentication, common fraud schemes, how to detect and guard against phishing attacks, how ponzi schemes work, as well as other risks which are unique to the cryptocurrency space.
In the event that protocols are breached, it is also important to have funds available to assist victims. While in this case, assistance came from the protocol, other situations may not compensate users. While assistance from an industry insurance fund is discretionary, and could be limited in cases where users used an unaudited smart contract, it would be able to assist quickly and prevent the devastation of a total capital loss.
Set up a multi-signature wallet with private keys held separately by delegate signatories from seven prominent platforms and services within the industry. Establish requirements for contributions by all platforms and services within the country, designed to be affordable for small platforms yet large enough to cover anticipated breach events. Any breach event can be brought forth by a member platform or a petition of 100 signatures for consideration by the delegate signatories. A vote of 4 or more delegate signatures is required to release any funds, which could partially or fully restore lost funds based on their assessment.
For the full list of regulatory policies that can prevent loss, check our Prevention Policies for Regulators guide.
References
- ↑ Rekt - Visor Finance - REKT (Jan 3, 2022)
- ↑ @GammaStrategies Twitter (Jan 3, 2022)
- ↑ Post Mortem For Vvisr Staking Contract Exploit And Upcoming Migration (Jan 3, 2022)
- ↑ Visor Merges With Gamma A Re Org Focusing On Security And Performance (Jan 3, 2022)
- ↑ 5.0 5.1 5.2 5.3 5.4 5.5 Defi Hack: Visor Finance to launch new token post 94% drop in price after exploit - CoinGape (Jan 3, 2022)
- ↑ Visor Finance - Active Liquidity Management on Uniswap v3 (Jul 14, 2021)
- ↑ 7.0 7.1 Gamma Strategies - "We are aware of an exploit of the vVISR staking contract and are impl[e]menting a migration plan for affected VISR. No positions or hypervisor's are at risk." - Twitter (Jan 3, 2022)
- ↑ 8.0 8.1 Santa Hackathon? Visor Finance Marks 7th Hack in December - Cryptonews (Dec 1, 2022)
- ↑ 9.0 9.1 Visor Finance Suffers another DeFi Hack as Losses Mount Up to $8.2M - Yahoo Finance (Jan 3, 2022)
- ↑ This is why Visor Finance (VISR) price plummeting (Jan 3, 2022)