New burnOverflow Bug Identified in Multiple ERC20 Smart Contracts (CVE-2018-11239)

PeckShield发现了名为“烧毁溢出”的智能合约漏洞,该漏洞影响了包括HexagonToken在内的几种ERC20代币。通过利用此漏洞,攻击者可以使用大量代币进行转账操作而不实际消耗任何代币。

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.


Figure 1: An Abnormal HXG Token Transfer (with Huge Amount)


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.

Figure 2: ERC-20 Standard transfer() Implementation

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.


Figure 3: A burnOverflow-affected Smart Contract


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.

## 01、数据介绍 数据整理全国30个省份制造业细分行业产值,能够反映一定时期内细分行业工业生产总规模和总水平的指标,是计算工业生产发展速度和主要比例关系、计算工业产品销售率等其他经济指标的基础。先进制造业数据可用于两业融合测算。 数据名称:全国30省-制造业细分行业产值/先进制造业细分行业产值数据 数据年份:2001-2022年 ## 02、数据指标 农副食品加工业;食品制造业;饮料制造业;烟草制造业;纺织业;纺织服装鞋帽制造业;皮革、毛皮、羽毛(绒)极其制品业;木材加工及木、竹、藤、棕、草制品业;家具制造业;造纸及纸制品业;印刷业和记录媒介的复制;文教体育用品制造业;石油加工、炼焦及核燃料加工业化;学原料及化学制品制造业;医药制造业;化学纤维制造业;橡胶和塑料制品制品业;非金属矿物制品业;黑色金属冶炼及压延加工业;有色金属冶炼及压延加工业;金属制品业;通用设备制造业;专用设备制造业;汽车制造业;其他运输设备制造业;电气机械及器材制造业;通信设备计算机及其他电子设备制造业;仪器仪表及文化、办公用机械制造业;其他制造业;废弃资源和废旧材料回收加工业;制造业总产值 印刷业和记录媒介的复制;石油加工、炼焦及核燃料加工业;化学原料及化学制品制造业;医药制造业;橡胶和塑料制品制品业;非金属矿物制品业;黑色金属冶炼及压延加工业;有色金属冶炼及压延加工业;金属制品业;通用设备制造业;专用设备制造业;汽车制造业;其他运输设备制造业;电气机械及器材制造业;通信设备计算机及其他电子设备制造业;仪器仪表及文化、办公用机械制造业;废弃资源和废旧材料回收加工业
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值