数据验证环节漏洞导致损失330万美元,详解Socket攻击事件始末

Odaily星球日报Publicado a 2024-02-04Actualizado a 2024-02-04

Resumen

2024年1月16日,Socket Tech遭到攻击,损失约330万美元,本文详解攻击事件始末。

数据验证环节漏洞导致损失330万美元,详解Socket攻击事件始末

2024 年 1 月 16 日,Socket Tech 遭到攻击,损失约 330 万美元。攻击者利用了 Socket 某合约中数据验证环节的漏洞,通过恶意数据输入盗取了授权合约的用户资金。这次攻击共给 230 个地址带来损失,最大的单地址损失约为 65.6 万美元。

背景介绍

Socket 是一种服务于跨链安全、高效数据和资产传输的互操作性协议。Socket Gateway 合约是与 Socket 流动性层所有交互的接入点,所有资产桥接器和 DEX 在此汇聚成一个唯一的元桥接器,并根据用户偏好(如成本、延迟或安全性)选择最佳交易路由。

黑客攻击发生的前三天,Socket 合约管理员执行了 addRoute 命令,在系统中加入了一条新路由。添加路由的目的是扩展 Socket 网关的功能,但却无意中引入了一个关键漏洞。

下图为通过合约管理员添加路由的记录:

数据验证环节漏洞导致损失330万美元,详解Socket攻击事件始末

事件梗概

1.北京时间 1 月 16 日 15: 03 ,攻击者钱包转入攻击所用资金,我们的时间分析表明这笔资金来自0x e 620 ,与从 Tornado Cash 提取的 10 BNB 有关。

数据验证环节漏洞导致损失330万美元,详解Socket攻击事件始末

2.这些资金被用于创建和执行两个合约来利用 Socket 的漏洞。第一个合约针对的是授权了 SocketGateway 的地址中的 USDC(截图如下)。127 名受害者被骗走约 250 万美元。

数据验证环节漏洞导致损失330万美元,详解Socket攻击事件始末

3.接下来,第二个合约则将目标对准了受害者地址内的 WETH、USDT、WBTC、DAI 与 MATIC。于是,另外 104 名受害者损失了约如下资产:

-42.48 WETH

-347, 005.65 USDT

-2.89 WBTC

-13, 821.01 DAI

-165, 356.99 MATIC

4.攻击者将 USDC 与 USDT 转换成了 ETH。

数据验证环节漏洞导致损失330万美元,详解Socket攻击事件始末

漏洞来源

被攻击者利用的漏洞存在于新添加的路由地址 routeAddress 内的 performAction 函数中。

该地址内的 performAction 函数原本的功能是协助 Wrapping 与 Unwrapping 的功能。

然而,该函数中出现了一个关键漏洞:用户在无需验证的情况下,直接在.call() 中通过 swapExtraData 调用外部数据,这意味着攻击者可以执行任意恶意函数。

数据验证环节漏洞导致损失330万美元,详解Socket攻击事件始末

在这次事件中,攻击者制作了一个恶意的 swapExtraData 输入,触发 transferFrom 函数。该恶意调用利用了用户对 SocketGateway 合约的授权,从他们那里盗走了资金。

虽然合约会通过检查余额检查确保 fromToken.call()调用后用户余额会出现正确的变化,但该函数没有考虑攻击者将金额设置为 0 的情况。

数据验证环节漏洞导致损失330万美元,详解Socket攻击事件始末

还原攻击流程

1.使用攻击合约,攻击者在 Socket Gateway 合约上调用了0x 00000196()。

数据验证环节漏洞导致损失330万美元,详解Socket攻击事件始末2.fallback() 使用六进制签名 196 调用了有漏洞的路由地址合约(routerAddress)。

数据验证环节漏洞导致损失330万美元,详解Socket攻击事件始末3.在下面的截图中,我们可以看到攻击者使用的虚假输入,Swapping 数量全部为 0 。

数据验证环节漏洞导致损失330万美元,详解Socket攻击事件始末4.接下来将调用 WrappedTokenSwapperImpl.performAction()进行 Swap。

数据验证环节漏洞导致损失330万美元,详解Socket攻击事件始末

5.在没有进行任何验证的情况下,虚假的 SwapExtraData 被 fromToken (WETH)接受并执行。

数据验证环节漏洞导致损失330万美元,详解Socket攻击事件始末

6.攻击者重复执行以上流程,直到受害者资产耗尽。恶意交易出现后,Socket 迅速调用了 disableRoute,屏蔽了之前有漏洞的路由,阻止了更大范围的攻击。

7.1 月 23 日,Socket 宣布已经追回 1032 枚 ETH,并在 25 日宣布将全额补偿所有损失。本次事件得到解决。

数据验证环节漏洞导致损失330万美元,详解Socket攻击事件始末

事件总结

在有着无限额用户授权的路由合约中,恶意 calldata 攻击并不罕见。

以前类似的攻击包括 Dexible 和 Hector Bridge。

2023 年 2 月 17 日,去中心化交易所 Dexible 被攻击,损失超过 150 万美元。漏洞利用者向 Dexible 的 fill()函数输入恶意 calldata,以窃取用户资产。

2023 年 6 月 2 日,Hector 网络的协议被攻击。攻击者部署了一个虚假的 USDC 合约,并通过恶意 calldata,将 65.2 万枚真实的 USDC 从受害者的合约中转移出去。

区块链聚合平台通常通过封装一系列桥和路由合约来提高流动性,减少损耗。然而,这种复杂的封装会给安全性带来更多难题。

Socket 此次事件可以得到解决无疑是各方努力的结果,CertiK 也将继续致力于为平台提供全方位审计与检测,降低各类聚合风险,提高社区信任和整个行业的安全水平。

Lecturas Relacionadas

The "Impossible Triad" Is Fundamentally a Pseudo-Problem

The article argues that blockchain's fundamental limitation is not the scalability trilemma (decentralization, scalability, security), which has been largely solved, but the lack of **privacy** and, until recently, clear **legitimacy**. Blockchain is described as a slow, expensive, globally shared computer whose core value is censorship resistance and verifiability. While ideal for native digital assets like money (e.g., stablecoins), its default transparency acts as a **tax**, exposing all transactions and enabling MEV extraction, which deters serious institutional capital. Simultaneously, its permissionless nature created regulatory ambiguity. The piece contends that **privacy** is the missing critical feature. It rejects the false choice between total transparency and complete anonymity. Modern cryptography (like zero-knowledge proofs) enables **compliant privacy**: users can prove facts (solvency, KYC status, compliance) without revealing the underlying sensitive data (specific holdings, identities). This preserves auditability for regulators and eliminates the leak of financial information. With recent regulatory progress (e.g., the GENIUS Act) addressing legitimacy, adding default, provably compliant privacy becomes a pure upgrade. It transforms blockchain from a costly, public ledger into a confidential settlement layer, finally bridging the gap to mainstream institutional and individual adoption of on-chain finance.

链捕手Hace 7 hora(s)

The "Impossible Triad" Is Fundamentally a Pseudo-Problem

链捕手Hace 7 hora(s)

Optical Chips: Collective Capacity Expansion

The global optical chip industry is experiencing a massive wave of expansion driven by surging AI data center demand. Major players across the US, Japan, Europe, and China are aggressively investing to ramp up production capacity. In the US, Coherent is expanding its 6-inch Indium Phosphide (InP) semiconductor fab in Texas, supported by CHIPS Act funding and a $2 billion strategic investment from NVIDIA. Lumentum is building a new factory for InP optical devices, and Nokia is scaling its advanced photonic chip packaging and testing capabilities. NVIDIA's investments aim to secure future supply of critical lasers and optical interconnect products for AI infrastructure. Japan's JX Advanced Metals, a leading InP substrate supplier, plans a multi-billion yen investment to increase its capacity 7-10 times, strengthening its grip on the crucial upstream materials market. In Europe, IQE and Tower Semiconductor settled a patent dispute and signed a multi-year InP epitaxial wafer supply agreement, highlighting that next-generation silicon photonics platforms will integrate high-performance InP components. STMicroelectronics and Sivers Semiconductors are also expanding silicon photonics production and partnerships. China is rapidly building out its domestic supply chain. Dongshan Precision's subsidiary, Source Photonics, announced a $12 billion project to expand optical chip and module production. Companies like Sanan Optoelectronics and Yunnan Germanium are scaling up InP chip manufacturing and substrate production, moving towards vertical integration from materials to modules. While debate continues around the exact future architecture—whether CPO (Co-Packaged Optics), NPO, or pluggables will dominate—analysts like Morgan Stanley argue the underlying driver is unchangeable: the explosive growth in bandwidth demand. This will inevitably increase the volume of optical engines, lasers, and related content per GPU, regardless of the final technical path. The competition for "more light" in the AI era has intensified into a global, full-chain capacity race.

marsbitHace 10 hora(s)

Optical Chips: Collective Capacity Expansion

marsbitHace 10 hora(s)

Stablecoins Finally Find Real Yield: An In-Depth Look at On-Chain Reinsurance Re | A Conversation with Re Founder Karan Saroya

Stablecoin Real Yield Found: A Deep Dive into On-Chain Reinsurance with Re's Karan Saroya As stablecoin supply exceeds $170 billion, the search for sustainable, non-speculative yield intensifies. Re, an on-chain reinsurance platform, provides an answer: connecting stablecoin capital to the trillion-dollar traditional reinsurance market. Re operates as a regulated reinsurer, accepting stablecoin deposits as collateral to back US insurance companies. These insurers pay premiums, generating yield that flows back to on-chain depositors. Currently supporting 35 insurers and underwriting $500 million, Re projects scaling to over $1 billion soon. Key insights from a Bankless podcast with founder Karan Saroya and investor Avichal of Electric Capital: 1. **Uncorrelated, Real-World Yield:** Re offers stablecoin holders access to reinsurance returns (targeting 12-14%+), an asset class entirely separate from crypto or equity markets. 2. **Operational Efficiency via Smart Contracts:** Re replaces traditional, labor-intensive capital fundraising with smart contracts, allowing a ~12-person team to compete with industry giants. 3. **Regulatory Leverage:** For every $1 of collateral, regulations allow backing $5-7 in written premiums. This leverage amplifies returns from the underlying risk-free rate. 4. **DeFi Integration:** Depositors receive receipt tokens, which can be used in protocols like Morpho for "looping," potentially pushing yields to 18-20%+. 5. **The "DeFi Mullet" Model:** A compliant front-end (regulated reinsurer) paired with a decentralized back-end (smart contracts, DeFi capital markets). 6. **RE Governance Token:** Modeled on Lloyd's of London, the token governs the central capital pool's allocation, counterparty acceptance, and parameters. 7. **Real Economic Impact:** Capital funds real-world productivity (factories, clinics, businesses) via insurance, moving beyond crypto's internal loops. The discussion highlights a pivotal moment: DeFi's supply-side infrastructure is now met by real demand for productive yield, potentially kickstarting a flywheel where vast on-chain stablecoin capital seeks these real-world returns.

链捕手Hace 11 hora(s)

Stablecoins Finally Find Real Yield: An In-Depth Look at On-Chain Reinsurance Re | A Conversation with Re Founder Karan Saroya

链捕手Hace 11 hora(s)

1996 or 1999? Walsh's First Test is 'How to View AI'

"1996 or 1999? Wall's First Big Test Is 'How to View AI'" Federal Reserve Chairman Wall's initial challenge is not whether to raise or cut rates, but a more fundamental judgment: what kind of boom is the current AI boom? This will determine the Fed's policy path and define his legacy. Economics is split between two opposing views, according to reporter Nick Timiraos. One sees imminent productivity gains that will increase supply and cool inflation, allowing the Fed to hold steady. The other argues that while productivity benefits are distant, demand shocks are here now, and waiting for data confirmation risks missing the intervention window, forcing sharper rate hikes later. Wall has signaled a leaning toward the first view, echoing 1996-era Alan Greenspan, who embraced strong, productivity-driven growth without fear of inflation. However, Wall faces a different macro environment than Greenspan did, with tariff pressures, expanding fiscal deficits, and diminishing globalization benefits, which could force more significant inflation pressures even if AI benefits materialize. Wall's logic, expressed before taking office, is that AI-driven productivity gains won't show in official data for years. If the Fed waits for confirmation, it might mistakenly tighten policy and choke off the very growth that could suppress inflation. This argues for using forward-looking narratives over lagging data. Chicago Fed President Austan Goolsbee presents a key counter-argument. He distinguishes between expected and unexpected productivity booms. A widely anticipated boom, like the current AI wave, can cause people to spend future wealth gains in advance, overheating the economy before productivity actually rises, thus requiring preemptive rate hikes. He cites rising costs for AI data centers as evidence of such overheating. Fed Governor Christopher Waller offers a rebuttal to Goolsbee, noting the "expected spending" mechanism only works if people can borrow against future income, which many households cannot do due to borrowing constraints. Wall also faces a paradox related to his desire to reduce the Fed's use of "forward guidance" (pre-announcing policy moves). This practice was established in 1999 when Greenspan began signaling hikes to avoid market shocks. If the economy follows a less optimistic path, Wall may be forced to choose between using the guidance he wants to abolish or risking market volatility by staying silent. The ultimate question defining Wall's first major test remains: Is this 1996 or 1999?

marsbitHace 12 hora(s)

1996 or 1999? Walsh's First Test is 'How to View AI'

marsbitHace 12 hora(s)

Trading

Spot
Futuros
活动图片