优惠论坛
Well123
注册
找回密码 |
天策评选的优秀公司,所有会员与公司发生的问题我们将负责尽力协助处理。
收起/展开
新晋公司
 

新晋公司具有驻站代表,并不在论坛纠纷服务范围内,请会员自行判断选择

  • 356
S级信誉公司
ManBetX万博
YZ
12BET
乐天堂
乐投
188金宝博
E世博
A级信誉公司
吉祥坊
星宝合营
乐动体育
B级信誉公司
bet365
C级合作公司
CMP
金星
LOKI
平博
  • 推荐主题
  • 热门活动
  • 币圈快讯
  • 商城动态
重要通知
 
天策搜索
论坛搜索
              搜索
Array ( [fid] => 6974 [description] => 专注于币圈最新最快资讯,数字货币应用及知识普及 [password] => [icon] => b1/common_6974_icon.png [redirect] => [attachextensions] => [creditspolicy] => Array ( [post] => Array ( [usecustom] => 1 [cycletype] => 1 [cycletime] => 0 [rewardnum] => 5 [extcredits1] => 1 [extcredits2] => 1 [extcredits3] => 0 [extcredits4] => 0 [extcredits5] => 0 [extcredits6] => 0 [extcredits7] => 0 [extcredits8] => 0 [rid] => 1 [fid] => 6974 [rulename] => 发表主题 [action] => post [fids] => 32,52,67,447,1120,1151,1156,6750,6762,6763,6766,6769,6772,6773,6787,6796,6808,6809,6810,6813,6814,6820,6829,6830,6846,6856,6864,6865,6827,6930,6931,6776,6858,6880,6764,6932,6871,6758,6905,1116,6788,6812,6798,6736,6759,6842,6966,6767,6828,6924,6935,6936,6938,6940,6941,6826,6909,6803,6919,6911,6908,6881,6920,6912,6913,6921,6925,6922,6789,6818,6819,6872,6928,6969,6889,6888,6917,6939,6947,6961,6937,6943,6970,6869,6900,6902,6783,6817,1111,6870,6821,6876,6952,6954,6960,6942,6910,6949,6962,6963,6964,6927,6926,6973,6728,6929,6874,6894,6896,6885,6857,6868,1113,6778,56,6844,6878,6802,6933,6811,6923,6877,6875,6918,6892,6757,6832,6833,6795,6793,6848,6837,6849,6850,6851,6852,6853,6854,6863,6882,6836,6790,6838,6794,6791,6873,555,6934,6958,6944,6945,6907,6779,6886,6950,6904,6956,6862,6957,6855,6955,6959,6914,6965,6971,6972,6953,6976,6824,6815,6891,6866,6979,6977,6765,6903,6948,6980,6981,6983,6799,6982,6951,6984,6975,6895,6845,6879,1121,6974 ) [reply] => Array ( [usecustom] => 1 [cycletype] => 1 [cycletime] => 0 [rewardnum] => 0 [extcredits1] => 0 [extcredits2] => 1 [extcredits3] => 10 [extcredits4] => 0 [extcredits5] => 0 [extcredits6] => 0 [extcredits7] => 0 [extcredits8] => 0 [rid] => 2 [fid] => 6974 [rulename] => 发表回复 [action] => reply [fids] => 32,52,67,447,1120,1151,1156,6750,6763,6766,6769,6772,6773,6787,6796,6808,6809,6810,6813,6814,6820,6829,6830,6846,6856,6864,6865,6827,6930,6931,6776,6858,6880,6764,6932,6871,6758,1116,6788,6812,6798,6736,6759,6842,6966,6767,6828,6924,6935,6936,6938,6940,6941,6826,6909,6803,6919,6911,6908,6881,6920,6912,6913,6921,6925,6922,6789,6818,6819,6872,6928,6969,6889,6888,6917,6939,6947,6961,6937,6943,6970,6869,6900,6902,6783,6817,1111,6870,6821,6876,6952,6954,6960,6942,6910,6949,6962,6963,6964,6927,6926,6973,6728,6929,6874,6894,6896,6885,6857,6868,1113,6778,56,6844,6878,6802,6933,6811,6923,6877,6875,6918,6892,6757,6832,6833,6795,6793,6848,6837,6849,6850,6851,6852,6853,6854,6863,6836,6790,6838,6794,6791,6873,555,6934,6958,6944,6945,6907,6779,6886,6950,6904,6956,6862,6957,6855,6955,6959,6914,6965,6971,6972,6953,6976,6824,6815,6891,6866,6979,6977,6765,6903,6948,6980,6981,6983,6799,6982,6951,6984,6975,6895,6845,6879,1121,6974 ) ) [formulaperm] => a:5:{i:0;s:0:"";i:1;s:0:"";s:7:"message";s:0:"";s:5:"medal";N;s:5:"users";s:0:"";} [moderators] => 实习版主1 [rules] => [threadtypes] => Array ( [required] => 1 [listable] => 1 [prefix] => 1 [types] => Array ( [1590] => 论坛公告 [1752] => 公司优惠 [1603] => 虚拟币交流 [1753] => 数字钱包 [1754] => 虚拟币存提 [1755] => 交易所 [1655] => 虚拟币资讯 [1756] => 银行卡 [1757] => 第三方支付 [1760] => 币圈大佬 [1758] => 科技前沿 [1759] => 天策嗨聊 [1661] => 入驻合作 ) [icons] => Array ( [1590] => [1752] => [1603] => [1753] => [1754] => [1755] => [1655] => [1756] => [1757] => [1760] => [1758] => [1759] => [1661] => ) [moderators] => Array ( [1590] => 1 [1752] => [1603] => [1753] => [1754] => [1755] => [1655] => [1756] => [1757] => [1760] => [1758] => [1759] => 1 [1661] => ) ) [threadsorts] => Array ( ) [viewperm] => 9 26 22 11 12 13 14 15 27 43 44 60 61 62 63 64 19 31 67 68 69 73 75 76 83 84 87 90 91 92 33 38 57 58 65 66 74 77 79 80 85 86 1 2 3 7 8 [postperm] => 22 11 12 13 14 15 27 43 44 60 61 62 63 64 19 67 68 69 73 75 76 83 84 87 90 91 92 33 38 57 58 65 66 74 77 79 80 85 86 1 2 3 [replyperm] => 26 22 11 12 13 14 15 27 43 44 60 61 62 63 64 19 67 68 69 73 75 76 83 84 87 90 91 92 33 38 57 58 65 66 74 77 79 80 85 86 1 2 3 [getattachperm] => 26 22 11 12 13 14 15 27 43 44 60 61 62 63 64 19 67 68 69 73 75 76 83 84 87 90 91 92 33 38 57 58 65 66 74 77 79 80 85 86 1 2 3 [postattachperm] => 26 22 11 12 13 14 15 27 43 44 60 61 62 63 64 19 67 68 69 73 75 76 83 84 87 90 91 92 33 38 57 58 65 66 74 77 79 80 85 86 1 2 3 [postimageperm] => 26 22 11 12 13 14 15 27 43 44 60 61 62 63 64 19 67 68 69 73 75 76 83 84 87 90 91 92 33 38 57 58 65 66 74 77 79 80 85 86 1 2 3 [spviewperm] => [seotitle] => [keywords] => [seodescription] => [supe_pushsetting] => [modrecommend] => Array ( [open] => 0 [num] => 10 [imagenum] => 0 [imagewidth] => 300 [imageheight] => 250 [maxlength] => 0 [cachelife] => 0 [dateline] => 0 ) [threadplugin] => Array ( ) [replybg] => [extra] => a:2:{s:9:"namecolor";s:0:"";s:9:"iconwidth";s:2:"60";} [jointype] => 0 [gviewperm] => 0 [membernum] => 0 [dateline] => 0 [lastupdate] => 0 [activity] => 0 [founderuid] => 0 [foundername] => [banner] => [groupnum] => 0 [commentitem] => [relatedgroup] => [picstyle] => 0 [widthauto] => 0 [noantitheft] => 0 [noforumhidewater] => 0 [noforumrecommend] => 0 [livetid] => 0 [price] => 0 [fup] => 6729 [type] => forum [name] => 虚拟币讨论大厅 [status] => 1 [displayorder] => 3 [styleid] => 0 [threads] => 22528 [posts] => 341872 [todayposts] => 12 [yesterdayposts] => 322 [rank] => 2 [oldrank] => 2 [lastpost] => 2690941 trx今天最高都涨到0.18美元以上了 1731472726 22301 [domain] => [allowsmilies] => 1 [allowhtml] => 1 [allowbbcode] => 1 [allowimgcode] => 1 [allowmediacode] => 0 [allowanonymous] => 0 [allowpostspecial] => 21 [allowspecialonly] => 0 [allowappend] => 0 [alloweditrules] => 1 [allowfeed] => 0 [allowside] => 0 [recyclebin] => 1 [modnewposts] => 2 [jammer] => 1 [disablewatermark] => 0 [inheritedmod] => 0 [autoclose] => 0 [forumcolumns] => 3 [catforumcolumns] => 0 [threadcaches] => 0 [alloweditpost] => 1 [simple] => 16 [modworks] => 1 [allowglobalstick] => 1 [level] => 0 [commoncredits] => 0 [archive] => 0 [recommend] => 0 [favtimes] => 0 [sharetimes] => 0 [disablethumb] => 0 [disablecollect] => 0 [ismoderator] => 0 [threadtableid] => 0 [allowreply] => [allowpost] => [allowpostattach] => )
打印 上一主题 下一主题
[虚拟币资讯] 创宇区块链|小缺陷大损失 GYM Network 何至于此
[复制链接]
avatar
跳转到指定楼层
1#

前言

北京时间 2022 年 6 月 8 日,知道创宇区块链安全实验室 自动数据监测工具监测到 BSC 链上 NFT 项目 GYM Network 因 "Public depositFromOtherContract" 权限控制问题被攻击,损失包括 7475 枚 BNB,共计约 216W 美元,目前已将兑通过 DEX 换 70W 美元的 ETH 通过 Celer 跨链到以太坊,2000 枚BNB 利用 BSC-Tornado 进行混币,余下 3000 枚 BNB 在攻击者地址。

知道创宇区块链安全实验室 第一时间跟踪本次事件并分析。

v2-53a786dd7aef75cf521e93cac6c2bd63_720w.jpg

基础信息

被攻击合约 :0x0288fba0bf19072d30490a0f3c81cd9b0634258a

攻击者地址:0xB2C035eee03b821cBe78644E5dA8B8eaA711D2e5

攻击合约:0xcD337b920678cF35143322Ab31ab8977C3463a45、0x68b5f1635522ec0e3402b7e2446e985958777c22

tx:0xfffd3aca0f53715f4c76c4ff1417ec8e8d00928fe0dbc20c89d875a893c29d89

GymSinglePool 代理合约: 0xa8987285e100a8b557f06a7889f79e0064b359f2

漏洞分析

项目方在 GymSinglePool 合约中实现过程中对于 0x0288fba0bf19072d30490a0f3c81cd9b0634258a#depositFromOtherContract 函数缺少了权限控制,导致攻击者能够通过该函数调用内部 _autoDeposit 函数实现零消耗质押:

v2-1dc3fead4e982d15e7615caaabcf98f2_720w.jpg

对于应该开放给用户的质押内部函数是 _deposit 函数,该函数实现了对于token 的审批传入,如下图所示:

v2-e42eb0989c553501f21b44128c37813a_720w.jpg

对应的 _autoDeposit 函数则实现了"特权"质押,即不需要转入 Token 进行质押。同时该函数直接暴露给了用户,函数对比如下:

v2-bab482eb0e32c6a14dd59b642f10520e_720w.jpg

攻击流程

攻击者为了防止链上 MEV 和抢跑机器人,将合约进行了分步部署执行,同时部署/调用了多次以完成对 GymNetwork 合约 (0x3a0d9d7764FAE860A659eb96A500F1323b411e68) 中的 GYMNET Token 完全抽离,以其中一笔部署调用为例:

1. 部署合约后调用 depositFromOtherContract 实"特权"质押,对应0xfd4a2266 方法:

v2-0459081369840abca1189f56a8684d15_720w.jpg

内部调用细节如下:

v2-05d4aa4c5a4e49aabfb0e89ae1ee8fd5_720w.jpg

2. 调用 0x30649e15 实现对上一步特权质押的 Token 回撤:

v2-644a2e26847e95a5cf6b8c5c1a266f15_720w.jpg

3. 利用 0x1d111d13 函数售出获取到的的 GYM-Token:

v2-fc7fcf67a7a0b6858d2831119c4ed27f_720w.jpg

重复多次"特权"质押--回撤--售出步骤,攻击者最终获取到 7475 枚 BNB :

v2-5ead3a57ca97983c730ebada94b09580_720w.jpg

为了抑制抢跑,攻击者将添加质押和回撤进行了步骤分离,两个步骤均为核心操作,同时刻意提高添加部分步骤的 Gas Price 为 15/20gwei, 可见攻击者是有意为之。

溯源处置

本次攻击原因是项目方实现的特权函数权限控制不当,在攻击发现的 1 小时后项目方将 GymSinglePool 代理合约的逻辑合约进行了多次修改,为其添加了权限控制:

v2-d99ca5bae2ef797b8d5bbaafa4994967_720w.jpg

并在 20 分钟后对逻辑合约添加了紧急账户处置函数:

v2-4d0867b6d3d526ad1ee4e9e91d3f8efc_720w.jpg

而对于项目方 Deployer 地址分析,其部署的多个 GymSinglePool 合约根据追踪仅在两天前部署的 GymSinglePool 合约中存在漏洞,4 天前的合约则不存在此函数:

v2-aa39ba686e1fee921f541d5cb685d67a_720w.jpg

同时代理合约对应的逻辑合约被升级为漏洞合约的事件发生在在 2 days 13 hrs ago:

v2-567e8a91084e7cce3dff3989f57f58fc_720w.jpg

攻击者的资金准备 (From Tornado) 则在约 6 小时以前,攻击者的身份也值得令人深思。

总结

虽然只是一处小的控制缺陷,却导致了数百万美元的损失。项目方的处置虽较为及时,漏洞导致的损失却难以挽回。该类型漏洞在审计过程中很容易被发现并将归纳到逻辑缺陷/不安全的外部调用,各项目方在开发和审计流程上切莫大意。

来源:金色财经

您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

:) :( :D :'( :@ :o
:P :$ ;P :L :Q :lol
:loveliness: :funk: :curse: :dizzy: :shutup: :sleepy:
:hug: :victory: :time: :kiss: :handshake: :call:
{:8_286:} {:8_287:} {:8_288:} {:8_289:}
{:8_290:} {:8_291:} {:8_292:} {:8_293:}
{:8_294:} {:8_295:} {:8_296:} {:8_297:}
{:8_298:} {:8_299:} {:8_300:} {:8_301:}
{:8_302:} {:8_303:} {:8_304:} {:8_305:}
{:8_306:} {:8_307:} {:8_308:} {:8_309:}
{:8_310:} {:8_311:} {:8_312:}
{:8_313:} {:8_314:} {:8_315:} {:8_316:}
{:8_317:} {:8_318:} {:8_319:} {:8_320:}
:) :( :D :'( :@ :o
:P :$ ;P :L :Q :lol
:loveliness: :funk: :curse: :dizzy: :shutup: :sleepy:
:hug: :victory: :time: :kiss: :handshake: :call:
:) :( :D :'( :@ :o
:P :$ ;P :L :Q :lol
:loveliness: :funk: :curse: :dizzy: :shutup: :sleepy:
:hug: :victory: :time: :kiss: :handshake: :call:
:hug: :victory:
:) :( :D :'( :@ :o
:P :$ ;P :L :Q :lol
:loveliness: :funk: :curse: :dizzy: :shutup: :sleepy:
:hug: :victory: :time: :kiss: :handshake: :call:
:hug: :victory: :time: :kiss: :handshake: :call:
:hug: :victory: :time: :kiss: :handshake: :call:
:hug: :victory: :time: :kiss: :handshake: :call:
:hug: :victory: :time: :kiss: :handshake: :call:
:hug: :victory: :time: :kiss: :handshake:
未有绑定记录
 


Powered by 天策论坛   © 2007-2024 天策论坛 | 小黑屋 | 手机|
1717 : 0