How I Used a JSON Deserialization 0day to Steal Your Money on the Blockchain

Presented at Black Hat USA 2021, Aug. 4, 2021, 3:20 p.m. (40 minutes).

Fastjson is a widely used open source JSON parser with 23'100 stars on GitHub. As a basic module of countless java web services, it serves hundreds of millions of users. We managed to find a way to bypass many security checks and mitigations by using the inheritance process of some basic classes, and achieve remote code execution successfully. We will disclose these high-risk and universal gadgets for the first time in this talk.

Now, we can control many important websites and affect millions of users. Let's make things more interesting. We found that this fastjson vulnerability affects a multi-billion-dollar blockchain. We designed multiple complex gadgets based on the features of the blockchain, and exquisitely achieved information leakage and pointer hijacking. Putting all these gadgets together, we achieved remote code execution on the blockchain nodes.

However, generally after remote code execution, we seem to have no better exploit method other than the 51% attack, which will lead to serious accounting confusion. After a detailed analysis of the architecture design of the public blockchain, we found a way from RCE to steal the public blockchain users' assets almost without any notification.

To the best of our knowledge, this is the first published attack case on the realization of covertly stealing user assets after RCE on the public blockchain nodes. We will propose a more covert post penetration exploit method for public blockchain nodes in this talk.

Blockchain is not bulletproof to security vulnerability and we hope our work can notify blockchain developers and users to be more careful about security.


Presenters:

  • Hao Xing - Senior Security Researcher, Tencent Security Xuanwu Lab
    Ronny Xing is a senior security researcher from Tencent Security Xuanwu Lab. He has spoken at Chaos Communication Congress and Black Hat Asia. His research subjects are Web security, Android security and Red Team. He is the first person of the research about breaking instant apps, which affected Google, Alibaba and TikTok.
  • Zekai Wu - Security Researcher, Tencent Security Xuanwu Lab
    Zekai Wu is a security researcher at Tencent Security Xuanwu Lab and his research focuses on Chrome and Blockchain Security. He has presented his security research at Black Hat Europe 2020.

Links:

Similar Presentations: