CVE-2018-10944: Vulnerability of ROC(aka Rasputin Online Coin) smart contract (Ethereum ERC20 token)
Abstract
I found a new vulnerability in smart contract of IDXM Token (CVE-2018–10666)[1]. Attackers can acquire contract ownership because the setOwner function is delcared as public. A new owner can subsequently bypass intended access restrictions by, for example, calling uploadBalances.
Details
In the following, I will explain more details about the vulnerability. Figure 1 shows the vulnerable setOnwer() function .
Figure 1. setOwner() function is delcared as public
In Solidity, there are four types of visibilities for functions: external, public, internal or private, where the default is public . setOwner() function is declared without any visibility, so it is declared as public. It means that anybody can call it and change owner variable. So, an attacker can change the owner variable to his account address.
What can attackers do?
There are important functions that should be called by only owner, such as uploadBalances, lockBalances, and so on. Those functions are protected by onlyOwner modifier which prevents calls from users who are not owner. An attacker can get the ownership of the contract using the vulnerability and then he can call any functions with owner authority. Therefore, he can call the functions declared with onlyOwner modifier.
Exploit
To confirm this vulnerability, I sent a transaction invoking the setOwnerfunction to change the owner as my account address.
Figure 2. Before the exploit, the owner is
‘0x000000ba8f84d23de76508547f809d75733ba170’which is same with contract creator
Figure 2 shows that the original state of the contract. The owner of the contract is same with the contract creator which is ‘0x000000ba8f84d23de76508547f809d75733ba170’.
After my exploit,the owner is changed as my account address
‘0xa4afe8bc10c32e8e0ca9db6f982e4d9490045407’. Figure 3 shows the result.
Figure 3. owner is changed as ‘0xa4afe8bc10c32e8e0ca9db6f982e4d9490045407’ after the exploit.
Figure 4 shows the exploit transaction .
Figure 4. Exploit transaction
Reports
When I found this vulnerability, I have immediately notified to Aurora which is admins of IDXM [5]. They said that it is a known bug and not critical. Actually, the attacker who gets ownership cannot do critical things such as manipulating user’s balances or destroying contract. The attacker can modify some important variables but admins can change it by getting owership again.
Conclusion
Declaring visibilitiy of functions is very important. Developers must declare the visibilitiy although it is public function. When they implement a function, they should deeply consider who can or cannot call it. Fortunately, this vulnerability is not critical but many smart contract will danger if their ownership is changed by anyone.
相關文章
- Attackers can steal all of Ether in ROC (Rasputin Online Coin) token smart contract (CVE-2018–10944)
- The phenomenon of smart contract honeypots
- 【阿菜Writeup】Security Innovation Smart Contract CTF
- 以太坊ERC20 TOKEN 0723 資料分析
- New proxyOverflow Bug in Multiple ERC20 Smart Contracts (CVE-2018-10376)
- New multiOverflow Bug Identified in Multiple ERC20 Smart Contracts (CVE-2018-10706)IDE
- New burnOverflow Bug Identified in Multiple ERC20 Smart Contracts (CVE-2018-11239)IDE
- ALERT: New batchOverflow Bug in Multiple ERC20 Smart Contracts (CVE-2018-10299)BAT
- AKA認證初探
- 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
- 使用Java+Web3j和Ethereum網路互動(二):部署ERC20並呼叫合約功能JavaWeb
- THM-Vulnerability Capstone
- SMART goals - SMART objectivesGoObject
- 322. Coin Change
- Open Wifi SSID Broadcast vulnerabilityWiFiAST
- 用PHP在去中心化交易所OceanOne上掛單買賣任意ERC20 tokenPHP中心化None
- Ethereum Geth Mirror
- PHP WDDX Serializier Data Injection VulnerabilityPHP
- Drupal - pre Auth SQL Injection VulnerabilitySQL
- Spring-Cloud-Contract實戰SpringCloud
- LeetCode - Medium - 322. Coin ChangeLeetCode
- [LeetCode] 518. Coin Change 2LeetCode
- ERC20介紹
- Go-ethereum 原始碼解析之 go-ethereum/ethdb/database.goGo原始碼Database
- .net C#程式碼契約Contract.Require Contract.Equal等為什麼不生效?C#UI
- Go-ethereum 原始碼解析之 go-ethereum/ethdb/memory_database.goGo原始碼Database
- Colombini Group Contract官網全新上線
- keras 上新增 roc auc指標Keras指標
- Smart Industry Operations
- CF1972B.Coin Games-博弈GAM
- Ethereum地址是如何生成的
- go-ethereum原始碼解析Go原始碼
- The Ethereum Virtual Machine(EVM)簡介Mac
- Online Book Repository
- create index .. onlineIndex
- [SEEDLab]競態條件漏洞(Race Condition Vulnerability)
- Analyzing and Reproducing the EOS Out-of-Bound Write Vulnerability in nodeos