Vaults.sx Retrospective

May 19, 2021

On May 14, 2021, a re-entry exploit on the flash.sx smart contract led to the theft of approximately 1.18M EOS and 462K USDT from the vaults.sx smart contract. This was despite the fact that the vaults.sx and flash.sx smart contracts are open-source, passed security audits from reputable auditors, and authority of the contract is distributed across 10 reputable DeFi partners (6/10 MSIG). 

The funds have been frozen through consensus of 15/21 elected EOS block producers.

Timeline of events

Here is a list of the key events as we understand them to have occurred. All times are listed in EDT time zone (UTC-4).

Raise the alarm

May 14

  • 7:28 EOS Nation was alerted of suspicious activity in vaults.sx via internal monitoring system.
  • 7:28 first unauthorized transaction that exploited a re-entry vulnerability resulted in loss of EOS for the contract.
  • 7:35 the thief finished taking all unstaked EOS from vaults.sx.
  • 7:52 EOS Nation called an emergency team meeting to triage and determine next steps.
  • 8:09 the thief took 462K USDT from vaults.sx.
  • 8:19 EOS Nation’s first communication went out to the community.

Limit the exposure

  • 8:21 the flash.sx smart contract was disabled via on notification alerts to the stats.sx contract preventing any additional losses from occurring from any remaining funds.
  • 9:03 EOS Nation proposed an MSIG to close deposits and withdrawals on vaults.sx.
  • 9:17 EOS Nation applied the thief’s account to our blacklist on our BP node (unfortunately these are only effective when 21/21 elected BPs apply them).
  • 9:39 6/10 DeFi partners executed the MSIG to close deposits and withdrawals on vaults.sx. 

Block the exits

  • EOS Nation alerted 8 of the most liquid exchanges with offramps from EOS to watch for deposits from the thief’s account. 
  • EOS Nation noticed that the thief used Binance to fund the creation of the account that carried out the attack and began the legal process to get a police warrant to obtain the thief’s identity information from the exchange. 
  • EOS Nation confirmed there was no identity information to be obtained.

Offer a way out

  • 11:17 EOS Nation offered a 100,000 USDT bounty for discovering the exploit and returning the funds.

Assess our options

  • 13:00 EOS Nation asked for advice from legal counsel.
  • 17:31 the thief initiated a cascading token shuffle process by creating new accounts, transferring the entire funds to the new account, leaving 5000 EOS to the previous account. This process is commonly used to evade the funds from being frozen via blacklist since the funds are continuously transferred to unknown accounts.
  • 19:00 EOS Nation called an emergency meeting with elected block producers.
  • 20:50 the thief’s account creation & token splitting process was complete and the funds were distributed across 246 accounts.

Freeze the funds

Assess the damage

May 15

Engage the thief

  • 21:00 the thief contacted former EOS Nation CEO, Yves La Rose, over Telegram to apologize for the damage caused and begin a dialogue.

May 16

Returning the funds

May 17

An unprecedented situation

There was no disputing the fact that this was theft: code did not behave as was intended. There were only three options available to block producers to handle this situation:

  1. Do nothing: let the thief have the depositor funds totalling $13M USD in value. 
  2. Blacklist accounts: 21/21 of elected producers modify their configuration to block any transactions being processed on the account. This option has been used in the past.
  3. Null keys: 15/21 of elected block producers execute an action to null the keys on the thief’s accounts to freeze the stolen funds.

To our knowledge, there has never been a prior circumstance in EOS where funds have been stolen due to an exploit of a smart contract that has been open-sourced, audited, and MSIGed. With the funds distributed across 246 accounts containing roughly 5000 EOS each, the funds were at risk of exiting the network via no-KYC exchanges at any moment. 

Failing to protect property rights in this instance could have had drastic consequences and result in a loss of faith in DeFi on EOS. As was the case with the Bitcoin rollback, the Ethereum DAO hack, and the HIVE fork, history has shown that the chain that protects property rights is the one that survives.

While it was preferable to blacklist the account, it was not possible to obtain the 21/21 block producer consensus required to do so in the short timeframe. So this led to the nulling of the keys. The decision was not an easy one.

EOS Nation played by the rules of the consensus mechanisms available to us. Whether or not those rules are appropriate for EOS going forward is another discussion we are happy to participate in.

Next steps

  • With the consent of the account owner, we propose the block producers sign the MSIG to transfer all of the recovered funds back to the originating flash.sx account, under the authority of the current 6/10 custodians.
  • Upon the retrieval of the funds, two historical snapshots will be published to easily identify SXEOS & SXUSDT token holders prior & after the event. Token holders with no change in their balance will be granted the posted value rate, token holders which have sold, withdrawn or moved their tokens will be reviewed on a case by case basis.
  • An MSIG will be proposed to return the funds to their rightful owners based on the published snapshot.
  • SXEOS & SXUSDT tokens will be reclaimed and burned, SX Vault & Flash will remain closed indefinitely.

Vaults.sx事件回顾

2021年5月14日,flash.sx智能合约上的一个re-entry漏洞攻击导致vaults.sx智能合约中约118万EOS和46.2万USDT被盗。大家需要知道, vaults.sxflash.sx智能合约是开源的,同时通过了知名审计人员的安全审计,并且合约的权限分布在10个知名的DeFi合作伙伴(6/10 MSIG)。

通过15/21 EOS节点的共识,这些资金已经被冻结。

事件时间线

以下是我们了解到的发生的关键事件时间线清单。所有时间都以美国东部时间区(UTC-4)为参考列出。

引起警觉

5月14日

  • 7:28 EOS Nation通过内部监控系统收到了vaults.sx可疑活动的警报。
  • 7:28第一笔利用re-entry漏洞的未经授权交易导致合约的EOS损失。
  • 7:35 盗贼完成了从vaults.sx中偷走所有未被抵押的EOS。
  • 7:52 EOS Nation召集了一次紧急小组会议,以进行调查并确定下一步措施。
  • 8:09盗贼从vaults.sx偷走了约46.2万USDT。
  • 8:19 EOS Nation向社区发出了第一次事件沟通

开始限制

  • 8:21 flash.sx智能合约通过禁止对 stats.sx合约无通知提醒的操作,来防止任何剩余资金遭受任何额外损失。
  • 9:03 EOS Nation提出了一个MSIG来关闭在vaults.sx上的存款和提款。
  • 9:17 EOS Nation在我们的BP节点上将盗贼账户添加到我们的黑名单中(不幸的是,只有当21/21节点都添加其到黑名单时,才有效)。
  • 9:39 6/10 DeFi合作伙伴执行了MSIG,以关闭vaults.sx上的存款和提款。

封锁出口

  • EOS Nation提醒8个流动性最强的交易所,提醒大家注意来自盗贼账户的存款。 
  • EOS Nation注意到,盗贼使用币安创建了实施攻击行为的账户,同时EOS Nation已经开始了法律程序,以获得警方的批准从交易所获得盗贼的身份信息。
  • EOS Nation已经确认没有任何身份信息可供获取。

提供一条出路

评估我们的选择

  • 13:00 EOS Nation向法律顾问征求意见。
  • 17:31 盗贼通过创建很多新账户启动了一个串联的代币洗牌过程,也就是不断将全部资金转移到新账户,并留下5000个EOS在前一个账户中。这个过程依靠资金被不断转移到未知的新账户,来逃避被黑名单冻结。
  • 19:00 EOS Nation召集了一次与当选节点的紧急会议。
  • 20:50 盗贼账户的创建和代币拆分过程已经完成,资金共被分配到246个账户中。

冻结资金

  • 20:44  vault MSIG 提出
    1. 由于交易的规模很大(514 updateauth),执行的延迟交易过期。
  • 21:22 提出3个新的MSIG,每个MSIG最多分为200个行动:
  • 22:10 MSIGs被执行:

评估损失

5月15日

与盗贼交涉

  • 21:00 盗贼通过Telegram联系了EOS Nation前CEO Yves La Rose,为造成的损失道歉并开始对话交涉。

5月16日

归还资金

5月17日

史无前例的境况

这是一种盗窃行为,这一点毋庸置疑:代码的执行力并不像预期的那样。对于节点来说,应对这种情况只有三种选择:

  1. 什么都不做:让盗贼坐享其成总价值1300万美元的存款资金。
  2. 将账户列入黑名单:21/21节点一起修改大家的配置,以阻止该账户上正在处理的任何交易。这一条已经使用。
  3. 清空密钥:15/21节点执行一项操作,将盗贼账户上的密钥置空,以冻结被盗资金。

据我们所知,在EOS中,从未出现过,通过利用已经开源、通过审计和MSIG的智能合约,而盗取资金的情况。由于这些资金被分布在246个账户中,每个账户大约包含5000个EOS,这些资金随时都有可能通过无KYC交易所而流出网络。

在这种情况下,如果不能保护产权,可能会产生严重的后果,导致人们对EOS上的DeFi失去信心。正如比特币回滚、以太坊DAO黑客攻击和HIVE分叉的情况一样,历史表明,保护产权的区块链才能长久生存。

虽然最好的操作是将该账户列入黑名单,但不可能在短时间内获得所有21/21个节点的共识。因此,这导致了现在需要清空密钥。做出这个决定并不容易。

EOS Nation按照我们现有的共识机制规则行事。这些规则是否适合于EOS的发展,是我们乐意参与的另一个讨论。

下一步措施

  • 在账户所有者同意的情况下,我们建议节点签署MSIG,在目前的6/10保管人授权下,将所有收回的资金转回原始Flash.sx账户
  • 资金收回后,将公布两个历史快照,以便轻松识别在事件发生前后的SXEOS和SXUSDT代币持有人。余额没有变化的代币持有者将被给予公布的价值率,出售、提现或转移代币的代币持有者将逐一根据具体情况进行审查。
  • 将提出一个MSIG,以根据公布的快照来将资金归还其合法所有者。
  • SXEOS和SXUSDT代币将被回收和烧毁,SX Vault和 Flash将无限期关闭。

Vault.sx 회고전

2018년 5월 14일, 리엔트리 공격이  flash.sx 스마트컨트랙에 가해졌으며, 대략 118만 EOS 와 46만 2천 USDT 규모의 자금이 vaults.sx 스마트컨트랙으로부터 도난되었습니다. vaults.sxflash.sx 스마트컨트랙은 모두 오픈소스이며 명성 높은 감사기관에 의한 보안감사도 맞췄습니다. 또한 컨트랙의 퍼미션은 10개의 잘 알려진 디파이 파트너들에 의해 관리됩니다. (6/10 MSIG)

자금은 21개의 BP 들 중 15개 BP 의 동의하에 동결되었습니다.

사건 시간 기록

저희가 현재 이해하고 있는 사건 발생의 순서와 시간은 다음과 같습니다. 모든 시간은 EDT 시간대 (UTC-4) 를 기준으로 기록되었습니다.

사건의 시작 

5월 14일 

  • 7:28 이오스네이션이 내부 모니터링 시스템을 통해서 vaults.sx에서의 의심스운 활동을 발견하였습니다. 
  • 7:28 첫 번째 비 허가 트랜잭션이 스마트컨트랙트에서 EOS 손실을 유발하였습니다. 
  • 7:35 해커가  vaults.sx에서 언스테이킹 된 EOS 를 모두 탈취하였습니다. 
  • 7:52 이오스네이션이 다음 단계를 의논하기 위해 긴급 팀미팅을 소집하였습니다. 
  • 8:09 해커가 vaults.sx에서 46만 2천 USDT를 탈취하였습니다. 
  • 8:19 이오스네이션가 커뮤니티와의 1차 소통을 진행하였습니다. 

피해 최소화 

  • 8:21  flash.sx 스마트컨트랙트가 stats.sx 컨트랙트로의 통지를 통해 비활성화 되어 잔여 자산의 추가적 손실 방지하였습니다. 
  • 9:03 이오스네이션이 vaults.sx의 예금과 출금을 비활성화하기 위한 MSIG 제출하였습니다. 
  • 9:17 이오스네이션이 BP 노드 블랙리스트에 해커의 계정을 추가신청하였습니다. (안타깝게도 이 신청은 21개 BP 모두가 참여시에만 유효)
  • 9:39 10개 중 6개의 디파이 파트너들이 vaults.sx의 예금과 출금기능을 제한하였습니다

출구봉쇄 

  • 이오스네이션이 8개의 가장 유동성 있는 거래소들에게 연락을 취해 해커의 계정을 예의주시 해달라고 요청하였습니다. 
  • 이오스네이션은 해커가 공격에 사용한 계정을 바이낸스를 통해 생성하였음을 밝혀내었으며, 거래소로부터 해커의 신원정보를 확보하기 위해 경찰 영장을 신청하였습니다. 
  • 이오스네이션은 해커에 대한 신원 정보가 없다는 것을 확인하였습니다. 

방법 제시 

선택지 평가 

  • 13:00 이오스네이션이 법무팀에게 조언을 구하였습니다. 
  • 17:31 해커가 토큰 셔플을 통해 전 계정에는 5000 EOS를 남겨두고 새로운 계정으로 자금을 전송하였습니다. 이러한 과정은 블랙리스트 계정의 자산 동결을 피하기 위해 자주 사용되는 방법입니다. 
  • 19:00 이오스네이션이 선출 BP들과의 긴급 미팅을 조직하였습니다. 
  • 20:50 해커의 계정 생성과 자금 분할 작업이 완료되었으며, 도난 당한 자금은 총 257개의 계정들에 분할 되었습니다. 

자산 동결 

많은 양의 액션(514개) 으로 인해 지연된 트랜잭션이 만기 되었습니다. 

피해평가 

5월 15일 

해커와의 대화 

  • 21:00 해커가 이오스네이션의 전 CEO Yves La Rose에게 텔레그램으로 연락을 취하여 자신이 초래한 결과에 대해 사과하고 대화를 시작하였습니다.  

5월 16일 

자금 반환 

5월 17일 

예측되지 못 했던 상황

이 사건이 절도 행위였음에는 의심의 여지가 없으며, 코드는 의도된 대로 작동하지 않았습니다. 이번 상황에서 BP들에게는 단 3가지의 선택지가 있었습니다: 

아무것도 하지 않는다: 해커가 총 1300만 USD 가치의 자산을 훔치도록 둔다. 

계정을 블랙리스트에 올린다: 21BP의 전체 동의에 따라, 해당 계정을 통해 어떠한 트랜잭션도 실행하지 못 하게 한다. 

키를 무효화한다: 15BP 의 동의하에 해커의 계정에 있는 자산을 동결시키기 위해 키를 무효화한다. 

현재까지 EOS 커뮤니티에서 단 한번도 오픈소스, 보안감사, MSIG 를 모두 거친 스마트컨트랙을 통한 해킹 사건은 일어난적이 없었습니다. 각각 5000 EOS 씩 들어있는 246개의 계정들을 통해, 도난 된 자산들은 KYC를 요구하지 않는 거래소들을 통해 빠져나갔습니다. 

재산권 보호에 실패하는 사건은 EOS 디파이 업계에 큰 파장을 불러일으킬 수 있습니다. 비트코인 롤백과 이더리움 DAO, 그리고 HIVE 포크까지, 역사는 재산권을 보호 할 블록체인의 역할은 살아남는 블록체인이 맡게 될 것이라는 것을 보여주고 있습니다. 

물론 블랙리스트를 사용했더라면 일이 더욱 쉽게 정리 되었을지라도, 그 짧은 시간 안에 21 BP의 전체 동의를 얻어내는 일은 거의 불가능에 가까웠습니다. 이는 키를 무효화하는 결과를 낳게 되었습니다. 정말 힘들게 내려진 결정이었습니다. 

이오스네이션은 이 컨센서스 매카니즘의 일부로써의 역할을 하였습니다. 이러한 역할들이 EOS 의 미래를 위해 적합한지 아닌지에 대해서 언제든지 기쁘게 토론 할 준비가 되어있습니다.

다음 단계

  • 계정 소유자의 암묵적 동의하에, 저희는 BP들이 MSIG 승인과 6/10 커스토디안 동의를 통해 도난 당한 자금을  flash.sx 계정으로 되돌려보내는 방안을 제안합니다. 
  • 자산 복구 외에도, 사건의 전후를 기준으로 SXEOS & SXUSDT 토큰 홀더들을 식별ㄹ하기 위한 역사적인 스냅샷이 공개 될 예정입니다. 밸런스에 변화가 없었던 홀더들은 스냅샷에 나와있는데로 토큰을 받으며 판매, 출금, 전송을 한 홀더들은 케이스별 검토를 받게 됩니다. 
  • 공개된 스냅샷에 따라 토큰을 재분배하는 MSIG가 제안 될 예정입니다. 
  • SXEOS & SXUSDT 토큰들은 재수령 및 소각 될 것입니다.  SX 볼트와 플래시는 당분간 서비스 재개를 하지 않을 예정입니다.

Daniel Keyes

Chief Operating Officer (COO)
Responsibilities include: product management, operations, community
Location: Toronto, Canada

Prior to founding the first EOS community in Toronto and co-founding EOS Nation, Daniel spent a decade in the financial technology industry working several diverse roles. His extensive experience in customer service, sales, sales coaching, agent training, digital marketing, digital process management (lean green belt), and product management (certified scrum master, certified product owner) eventually lead him to consulting for a blockchain dev shop.

Daniel earned a Bachelor of Journalism from Ryerson University in 2009 and worked as a chase producer intern at Global TV.

Daniel lives by the principles of Truth, Love, and Freedom.