Lighter Attack Chronology: How an API Key Took Away Tens of Millions of Dollars?

CN
20 minutes ago
The funding path and permission questions of the Lighter security incident.

Written by: KarenZ, Foresight News

The hacker obtained the API key for a trading account of Lighter but found that they did not have permission to transfer the funds out.

Logically, the attack should have stopped there.

However, during the security incident that occurred on November 16 at the decentralized perpetual contract trading platform Lighter, the attacker seemingly found another method: first closing the trading position, then creating a public funding pool, transferring the victim account's funds into it, and finally completing the transfer by redeeming shares from the funding pool.

The originally set restrictions on transferring funds may have been circumvented by a series of normal product functions.

According to analysis from the Korean community relayed by arb.sh founder 0xTria, this incident involved two large market-making accounts at Lighter, with related funds totaling approximately 15.48 million USDC. The attacker is suspected of using the leaked API key and the platform's internal account mechanism to transfer assets rather than directly attacking Lighter's smart contract.

Lighter's latest investigation results have confirmed the most important point: this incident was caused by the leakage of an API key from a specific trader's account, not an attack on the protocol or smart contract.

Lighter's latest response has clarified the cause of the incident. However, how the attacker managed to use an API key that did not possess direct transfer permissions to complete a fund transfer on the scale of tens of millions of dollars remains the most concerning issue of the entire incident.

As a result of this security incident, the price of Lighter's token LIT temporarily dropped, with a decline of over 12% in the past 24 hours, currently reported at about 2.6 USD.

Without withdrawal permissions, how was 15.5 million USD transferred out?

The incident initially caught market attention due to an unusually large USDC withdrawal.

According to blockchain analyst MLM, an address with previously low activity withdrew about 10.39 million USDC from Lighter and quickly exchanged it for ETH through CoW Protocol.

Subsequently, 0xTria relayed an analysis from a Korean trader regarding the incident, pointing out that this attack might involve the leakage of API keys from two large market-making accounts, rather than vulnerabilities in Lighter's core protocol itself.

According to that analysis, the two affected accounts were #714710 and #714723, involving amounts of about 10.39 million and 5.09 million USDC respectively, totaling about 15.48 million USDC.

It is worth noting that Lighter's latest statement confirms the leakage of an API key from a specific trader's account but does not confirm the ownership of the two accounts, nor does it disclose the loss figure of about 15.48 million USD. Therefore, the number of accounts and the amounts involved remain third-party analytical results.

So, why did the leakage of the API key cause such a significant financial loss?

For market makers and quantitative trading firms, the API key is an indispensable tool for automated trading. Trading programs can place orders, cancel orders, and adjust positions through the API without the need for traders to operate manually.

Lighter's official documentation shows that a regular API key can execute transfers between accounts owned by the same owner; transferring to other owners requires additional wallet signatures. Although secure withdrawals can be initiated solely with the API key, the destination can only be the L1 address of the account owner.

Therefore, the restriction here can be understood as: an API key alone cannot directly transfer money to another owner's account.

According to the analysis relayed by 0xTria, the attacker exploited the relationship between this permission system and public funding pools.

First, the attacker is suspected of using the victim account's API permissions to close all existing trading positions, releasing the margin available for trading.

Then, the attacker created a public funding pool with 0% transaction fees using the victim account and invested about 10,000 USD from an account they control to obtain about 99.99% of the shares in the pool.

It needs to be explained what Lighter's public funding pool is. According to Lighter's official white paper, a public funding pool is a special trading sub-account. The pool can execute trading strategies, while other users can invest funds to purchase shares and share the trading profits and losses according to their holdings.

Simply put, it is like a trading strategy account that allows other investors to participate. Who creates the pool and who owns the shares within it are two different concepts.

According to the analysis relayed by 0xTria, even though the attacker created the pool using the victim account, they effectively acquired the vast majority of the shares through their contribution.

The next step is crucial. The attacker is suspected of using the internal transfer permissions of the victim account to transfer USDC into the funding pool in batches, each time about 1 million USD, and then redeeming the assets corresponding to the shares they controlled in the funding pool.

Why might this path be feasible?

According to 0xTria's relay, Lighter's trading API cannot directly transfer to other users, but when conducting internal transfers between accounts associated with the same L1 address, additional signatures may not be required. The public funding pool created by the victim account is also considered as an associated account within the platform's account system.

Based on my understanding, if the above analysis is accurate, the crux of the issue may lie in the fact that internal transfers and shares redemption are two different operations. When the attacker transferred USDC from the victim account into the public funding pool, the system may have viewed it merely as a balance transfer between associated accounts rather than a normal shares purchase, hence it would not mint new shares for the victim account.

Consequently, while the assets of the funding pool increase, the vast majority of the shares previously held by the attacker are not diluted, causing their corresponding asset value to rise, and thereby potentially allowing them to redeem funds that originally belonged to the victim account.

However, this mechanism is still based on an inference drawn from the attack path described by 0xTria, and Lighter has not disclosed the specific technical details of whether the internal transfer triggered share minting.

Where did the money go? The attacker also attempted additional withdrawals

0xTria's early relayed analysis listed two accounts: #714710 involving approximately 10.39 million USD and #714723 involving approximately 5.09 million USD. Adding these two rounded numbers gives about 15.48 million USD, which has been widely circulated as "about 15.5 million USD." 0xTria subsequently mentioned about 17.5 million USD but did not provide additional details or explanations for the discrepancy.

On-chain records show that at 17:35:11 on November 16, Beijing time, the relevant address deposited 10,200 USDC into Lighter via Relay, recorded in the corresponding account #769455.

179483792450100.jpg

At 18:11:47, that address called the withdrawal pending balance function (withdrawPendingBalance) of Lighter's main contract and received about 10.3931 million USDC, approximately 36 minutes after the previous deposit.

179483792471545.jpg

Between 18:13 and 18:17, that address executed five transactions through CoW Protocol, converting 10.36 million USDC to about 5751.63 ETH/WETH.

179483792495188.jpg

There were two additional operations: at 18:21:35, that address deposited another 10,200 USDC into Lighter, similarly recorded in account #769455.

179483792514296.jpg

At 18:46:23, that address further converted 23,200 USDC into 12.84 ETH.

The six transactions collectively spent 10,383,182.629682 USDC, receiving about 5764.470028 ETH/WETH in return.

Subsequently, the funds were dispersed to multiple addresses. Bubblemaps tracking indicated that some of the funds flowed to Hyperliquid and were converted into XMR1, which is wrapped Monero.

Regarding the identity of the victim, 0xTria suspects that the relevant accounts belong to Abraxas Capital, based on the initial funds of one of the affected accounts coming from a wallet identified as belonging to that institution via Hyperliquid.

Lighter was not breached, but does that mean there are no security issues?

Lighter's latest response attributes the incident to the leakage of a trader's API key and states that the protocol and smart contracts were unaffected. This is the current conclusion of the official investigation, though subsequent technical reviews are needed to provide more complete evidence.

This conclusion also raises another question: why might a key lacking direct external transfer permissions possibly complete value transfers through a funding pool?

If the third-party descriptions are ultimately verified, the key lies in the junction of the two permission rules: internal transfers are judged by the account owner, while funding pool redemptions are settled by the share holders. When the nominal owner of the pool differs from the economic beneficiaries, merely checking "is it transferred to one's own name" may not suffice to determine who ultimately claims the funds.

This does not imply that it has been proven that a segment of contract code contains a vulnerability but rather indicates that security scrutiny still needs to cover the results of functional combinations.

Guardian mode activated, what needs to be confirmed next?

Lighter stated that it has enabled Guardian mode, and the security committee will execute contract upgrades, prioritizing the recovery of funds involved in the attacker's additional withdrawal attempt. Withdrawals remain temporarily closed, with the goal of completing the upgrade and restoring withdrawals "before the end of the day" as specified in the announcement.

Next, the first thing that needs to be confirmed is the list of affected funds: which assets have been transferred out, which are still in the withdrawal process, and which have been recovered.

Secondly, a complete attack path needs to be disclosed. Mainnet withdrawal transactions can prove that funds left Lighter but cannot independently prove the prior processes of closing positions, pool creation, and share redemption. These stages require internal trading records and technical reports from Lighter to supplement.

Finally, it is necessary to clarify what changes were made during the upgrade and when withdrawals will actually resume. These results will help users assess whether the risk is under control.

免责声明:本文章仅代表作者个人观点,不代表本平台的立场和观点。本文章仅供信息分享,不构成对任何人的任何投资建议。用户与作者之间的任何争议,与本平台无关。如网页中刊载的文章或图片涉及侵权,请提供相关的权利证明和身份证明发送邮件到[email protected],本平台相关工作人员将会进行核查。

Share To
APP

X

Telegram

Facebook

Reddit

CopyLink