Kava Labs Accounting Logic Error: Difference between revisions
(Created page with "{{Imported Case Study|source=https://www.quadrigainitiative.com/casestudy/kavalabsaccountinglogicerror.php}} thumb|Kava LabsKava Labs is a set of multiple DeFi protocols that work together. The protocol launched an update (Kava 5) which had an error. A fixed version of the protocol was relaunched within 24 hours and no funds were lost. This is a global/international case not involving a specific country. == About Kava Labs == "Kava Labs was found...") |
No edit summary |
||
| Line 1: | Line 1: | ||
{{Imported Case Study|source=https://www.quadrigainitiative.com/casestudy/kavalabsaccountinglogicerror.php}} | {{Imported Case Study|source=https://www.quadrigainitiative.com/casestudy/kavalabsaccountinglogicerror.php}} | ||
{{Unattributed Citations}} | |||
[[File:Kavalabs.jpg|thumb|Kava Labs]]Kava Labs is a set of multiple DeFi protocols that work together. The protocol launched an update (Kava 5) which had an error. A fixed version of the protocol was relaunched within 24 hours and no funds were lost. | [[File:Kavalabs.jpg|thumb|Kava Labs]]Kava Labs is a set of multiple DeFi protocols that work together. The protocol launched an update (Kava 5) which had an error. A fixed version of the protocol was relaunched within 24 hours and no funds were lost. | ||
This is a global/international case not involving a specific country. | This is a global/international case not involving a specific country. | ||
<ref name="openblocksecgithub-2342" /><ref name="kavalabsmedium-3066" /><ref name="kava-3067" /><ref name="kava-3068" /><ref name="crunchbase-3069" /> | |||
== About Kava Labs == | == About Kava Labs == | ||
| Line 51: | Line 53: | ||
Don't Include: | Don't Include: | ||
* Any wording which directly states or implies that the business is/was illegitimate, or that a vulnerability existed. | * 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. | * Anything that wasn't reasonably knowable at the time of the event. | ||
| Line 73: | Line 74: | ||
|- | |- | ||
|March 5th, 2021 12:00:00 AM | |March 5th, 2021 12:00:00 AM | ||
| | |Main Event | ||
| | |Expand this into a brief description of what happened and the impact. If multiple lines are necessary, add them here. | ||
|- | |- | ||
| | | | ||
| Line 86: | Line 83: | ||
== Total Amount Lost == | == 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? | How much was lost and how was it calculated? If there are conflicting reports, which are accurate and where does the discrepancy lie? | ||
| Line 97: | Line 94: | ||
== Total Amount Recovered == | == 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? | What funds were recovered? What funds were reimbursed for those affected users? | ||
| Line 105: | Line 102: | ||
== Prevention Policies == | == Prevention Policies == | ||
Which policies could have prevented this event from happening? | |||
== References == | == References == | ||
[https://github.com/openblocksec/blocksec-incidents/blob/main/defi/2021.md blocksec-incidents/2021.md at main · openblocksec/blocksec-incidents · GitHub] (Aug 10) | <references><ref name="openblocksecgithub-2342">[https://github.com/openblocksec/blocksec-incidents/blob/main/defi/2021.md blocksec-incidents/2021.md at main · openblocksec/blocksec-incidents · GitHub] (Aug 10, 2021)</ref> | ||
[https://medium.com/kava-labs/kava-5-launch-post-mortem-e81a4ae01666 Kava 5 Launch Post Mortem] (Aug 10) | <ref name="kavalabsmedium-3066">[https://medium.com/kava-labs/kava-5-launch-post-mortem-e81a4ae01666 Kava 5 Launch Post Mortem] (Aug 10, 2021)</ref> | ||
[https://www.kava.io/ Kava Platform | Grow your crypto safely] (Aug 20) | <ref name="kava-3067">[https://www.kava.io/ Kava Platform | Grow your crypto safely] (Aug 20, 2021)</ref> | ||
[https://www.kava.io/about Kava | About] (Aug 20) | <ref name="kava-3068">[https://www.kava.io/about Kava | About] (Aug 20, 2021)</ref> | ||
[https://www.crunchbase.com/organization/kava-labs Kava Labs - Crunchbase Company Profile & Funding] (Aug 20) | <ref name="crunchbase-3069">[https://www.crunchbase.com/organization/kava-labs Kava Labs - Crunchbase Company Profile & Funding] (Aug 20, 2021)</ref></references> | ||
Revision as of 13:57, 17 February 2023
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!
Kava Labs is a set of multiple DeFi protocols that work together. The protocol launched an update (Kava 5) which had an error. A fixed version of the protocol was relaunched within 24 hours and no funds were lost.
This is a global/international case not involving a specific country. [1][2][3][4][5]
About Kava Labs
"Kava Labs was founded in 2017 and based in San Francisco, California." "Kava Labs, Inc., the parent company behind Kava, was co-founded by Brian Kerr, Ruaridh O'Donnell and Scott Stuart."
"Kava is the most trusted DeFi platform by financial institutions. Securely access a robust suite of DeFi products and services in one safe and seamless integration."
"Kava brings together everything that's required to do frictionless decentralized finance. Many companies have already integrated with Kava's DeFi platform to allow their users to lend, invest, and earn with crypto." "Securely access a robust suite of decentralized financial services in one safe and seamless integration."
"Built on the Cosmos blockchain, Kava makes use of a collateralized debt position (CDP) system to ensure stablecoin loans are always sufficiently collateralized. If a borrower fails to maintain their collateral above a required threshold, the Kava liquidator module will seize collateral from failing CDPs and send it to the auction module for sale."
"In addition to Kava's USDX stablecoin, the Kava blockchain also includes the native KAVA token. This is a utility token used for voting on governance proposals and also functions as a reserve currency for when the system is undercollateralized."
"The Kava 5 launch was rolled back after a bug was discovered by the Kava core developer team shortly after launch." "Events took place from March 5th — March 6th, 2021." "Kava-5 chain launche[d] when a 2/3 majority of staking power [came] online." "While conducting QA tests on the newly launched chain, Kava engineers observe[d] unexpected values in some users HARD claim objects." "After reviewing available options, and confirming all user funds are safe, the decision is made to use the safety committee to shutdown the chain."
"As part of the developer team’s internal audit of HARD protocol, this PR was introduced to fix a bug in the accounting logic of HARD protocol liquidations. During the code review, it was pointed out that safe subtraction should be used to avoid negative coin amounts, which cause a panic in the cosmos-sdk sdk.Coins object."
"Quite obviously, this subtraction of coin sets results in the disjoint elements of borrowedCoins being completely dropped from the calculation. This miscalculation of total borrowed and supplied coins then had the downstream effect of producing inaccurate reward calculations for HARD Protocol claim objects which was caught immediately after Kava 5 launch."
"Because Kava has a unique liquidity incentive architecture, it’s worth breaking down what exactly a “HARD claim” is and what it represents. In HARD protocol, users earn claims on HARD tokens proportional to the amount of liquidity they provide. The claim object represents the balance of HARD tokens the user would be entitled to if they claimed with the longest vesting period (1 year). At any time, a user can claim their HARD token balance using a MsgClaimReward transaction. When claiming, the user declares how long the HARD tokens will be vesting, either 1 month or 1 year, and the tokens are transferred from the hard module account to the user’s vesting account. Because all Hard claims are vesting, users cannot immediately transfer tokens from MsgClaimRewards ."
"No inflationary HARD tokens were created or could have been created as a result of the bug. Users were accumulating anomalously claims on the hard module account balance. Because the hard module account balance is fixed, it would have been impossible to pay these claims out."
"Users who did successfully claimed anomalous HARD token balances could not have spent them. By design, time-locked rewards prevent scenarios where a bug in reward calculations can immediately be withdrawn."
"The safety committee worked as intended. The goal of the safety committee is to give Kava an ‘escape hatch’ for high severity and/or actively exploited bugs that potentially put user funds or the security of the chain at risk. Pretty much the only time this is useful is right after upgrades, or immediately after an exploit is observed. Most importantly, while it provides a method to pause the chain, it does not provide a method to it to bring it back online — that is up to the validators and done in coordination with all Kava governance participants. Kava Labs and the greater Kava governance will always be transparent in its decision making process, and are always open to feedback about how to be better stewards of the platform."
"All addresses that attempted (successfully or unsuccessfully) to claim HARD rewards on kava-5 will be distributed a 250 HARD bug bounty."
We will "budget [additional] time for reviewing audit fixes which [come] up going forward, both by budgeting more time upfront, but also by incorporating an audit completion check into the process where we decide if the allotted time was insufficient and should be extended." "Going forward, we will have a ‘rollback’ playbook for each launch that we will communicate so that launch members have a routine to follow in the case of launch rollbacks."
"While this launch was ultimately unsuccessful, there are many improvements to the product development and release cycle that we have made that I am extremely proud of and extremely excited to keep improving."
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.
| Date | Event | Description |
|---|---|---|
| March 5th, 2021 12:00:00 AM | Main Event | Expand this into a brief description of what happened and the impact. If multiple lines are necessary, add them here. |
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?
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?
Prevention Policies
Which policies could have prevented this event from happening?
References
- ↑ blocksec-incidents/2021.md at main · openblocksec/blocksec-incidents · GitHub (Aug 10, 2021)
- ↑ Kava 5 Launch Post Mortem (Aug 10, 2021)
- ↑ Kava Platform | Grow your crypto safely (Aug 20, 2021)
- ↑ Kava | About (Aug 20, 2021)
- ↑ Kava Labs - Crunchbase Company Profile & Funding (Aug 20, 2021)