New burnOverflow Bug Identified in Multiple ERC20 Smart Contracts (CVE-2018-11239)
Our vulnerability-scanning system at PeckShield has so far discovered several dangerous smart contract vulnerabilities ( batchOverflow[1], proxyOverflow[2], transferFlaw[3],ownerAnyone[4], multiOverflow[5]). Some of them could be used by attackers to generate tokens out of nowhere while others can be used to steal tokens from legitimate holders.
Today, we would like to report another vulnerability called burnOverflow that affects a few ERC20-related tokens. In particular, one such token, i.e., Hexagon Token (HXG), has already been attacked in the wild. Specifically, on 5/18/2018, 12:55:06 p.m. UTC,PeckShield detected such attacking transaction (as shown in Figure 1) where someone callstransfer() with a huge amount of HXG token — 0xffff,ffff,ffff,ffff,ffff,ffff,ffff,ffff,ffff,ffff,ffff,ffff,ffff,ffff,ffff,fffe to another address without actually spending any HXG token.
From our investigation, we show in Figure 2 the implementation logic of the standard ERC-20 transfer() function in the HXG smart contract. It simply calls _transfer() (in line 26) to perform the actual task.
In the _transfer() function, we can see that in line 81, the calculation of _value + burnPerTransaction could be overflowed for bypassing the check of sender’s balance.
Since burnPerTransaction is set as 2, the attacker can make _value + burnPerTransaction = 0 by making _value = 0xffff,ffff,ffff,….,fffe. As the balance of _to is less than 2, the check in line 85 could be passed. Then, the balance of _from is decremented by 0 (_value + burnPerTransaction) in line 85. Finally, the tremendous amount of HXG token is added tobalanceOf[_to] in line 87.
Since HXG token is currently listed in token.store for trading, we contact the development team at the first place to prevent any possible financial loss. As warned in our vulnerability reports, all the calculations without utilizing SafeMath can easily introduce vulnerabilities in smart contracts and cause undesirable damage or loss.
相關文章
- New multiOverflow Bug Identified in Multiple ERC20 Smart Contracts (CVE-2018-10706)IDE
- New evilReflex Bug Identified in Multiple ERC20 Smart Contracts (CVE-2018-12702, CVE-2018-12703)FlexIDE
- New allowAnyone Bug Identified in Multiple ERC20 Smart Contracts (CVE-2018-11397, CVE-2018-11398)IDE
- New ceoAnyone Bug Identified in Multiple Crypto Game Smart Contracts (CVE-2018-11329)IDEGAM
- New proxyOverflow Bug in Multiple ERC20 Smart Contracts (CVE-2018-10376)
- ALERT: New batchOverflow Bug in Multiple ERC20 Smart Contracts (CVE-2018-10299)BAT
- New ownerAnyone Bug Allows For Anyone to ''Own'' Certain ERC20-Based Smart Contracts (CVE-2018-10705AI
- CVE-2018-10944: Vulnerability of ROC(aka Rasputin Online Coin) smart contract (Ethereum ERC20 token)
- SMART goals - SMART objectivesGoObject
- Bug 12725963 - New database connection fails with ORA-12541 after vip failoverDatabaseAI
- [BUG反饋]onethink 登陸時呼叫$User = new UserApi; 報錯。API
- openzeppelin/contracts/utils/Counters.sol" not found
- ERC20介紹
- JavaScript select multipleJavaScript
- Logstash Multiple Pipelines
- Smart Industry Operations
- Small Multiple(最短路)
- 2.3.6.2 Synchronization of Multiple ApplicationsAPP
- LLM multiple modal applicationsAPP
- kubernetes traefik multiple namespacesnamespace
- Laravel 原始碼閱讀指南 -- Contracts 契約Laravel原始碼
- new self()與new static()
- GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘root‘ WITH GRANT OPTION;報錯IDE
- The phenomenon of smart contract honeypots
- Multiple Books多賬薄
- POJ1426-Find The Multiple
- New
- Mysql8.0不支援grant all privileges on *.* to root@“%“ identified by “.“;MySqlIDE
- 重構smart-importImport
- Slither: A Static Analysis Framework For SmartFramework
- Smart Value Help 總結
- onClick事件中點選跳轉新的activity提示FLAG_ACTIVITY_NEW_TASK的奇怪bug事件
- JavaScript中的new map()和new set()使用詳細(new map()和new set()的區別)JavaScript
- Lowest Common Multiple Plus hd 2028
- 理解new和實現一個new
- 【區塊鏈100問】ERC20代幣那麼火爆, 那麼ERC20到底是什麼?區塊鏈
- new learn
- a new ideaIdea