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

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

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.

### 关于 MySQL 输入验证错误漏洞 CVE-2022-21454 #### 漏洞详情 CVE-2022-21454 是指在 MySQL 数据库管理系统中的输入验证存在缺陷。当处理特定类型的 SQL 查询时,如果用户提供了恶意构造的数据作为参数,则可能导致服务器崩溃或执行任意代码。此问题影响多个版本的 MySQL 和 MariaDB,在某些情况下可能被远程攻击者利用来实施拒绝服务(DoS)攻击或其他更严重的后果。 具体来说,该漏洞存在于解析 JSON 文档的过程中[^3]。由于未能正确地检查传入数据的有效性,使得未经适当清理的内容能够绕过正常的防护机制并触发内部逻辑错误。这不仅限于直接通过应用程序接口提交的信息;还包括任何可以间接传递给数据库引擎的地方,比如存储过程调用、事件调度器任务等。 #### 影响范围 受影响的产品及其版本如下: - Oracle MySQL Server 8.0.27 及之前版本 - Percona Server for MySQL 8.0.x 系列 - MariaDB 10.6.x, 10.5.x, 10.4.x 各分支 对于企业级部署而言,及时评估当前使用的软件是否处于风险之中至关重要。建议管理员查阅官方发布的安全公告以获取最准确的影响列表[^3]。 #### 解决方法与缓解措施 针对这一安全隐患,厂商已经发布了补丁程序更新。为了防止潜在威胁的发生,强烈推荐采取以下行动: 1. **立即升级至最新稳定版**:安装由供应商提供的修复包是最有效的解决办法。例如,Oracle 已经在其后续发行版中解决了这个问题,如 MySQL 8.0.28 或更高版本。 2. **应用临时修补脚本**:如果无法马上进行全面迁移,可以通过修改配置文件的方式减少暴露面。设置严格的连接限制和资源控制策略有助于降低危害程度。此外,还可以考虑启用只读模式或将敏感操作迁移到隔离环境中运行。 3. **加强审计日志记录强度**:确保启用了详细的查询历史追踪功能,并定期审查异常活动迹象。这样可以在早期发现可疑行为并作出响应。 4. **强化身份认证体系**:采用多因素验证(MFA),并对不同级别的权限进行精细化管理。最小化特权原则同样适用于数据库账户分配场景下,即授予刚好足够的访问权利完成必要的工作即可。 ```sql ALTER USER 'your_user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'StrongPassword!'; FLUSH PRIVILEGES; ``` 以上SQL语句用于更改指定用户的密码为强随机字符串形式,从而提高安全性[^3]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值