Cointime

Download App
iOS & Android

Uncovering the Twist Attack Vulnerability: Was This a Failed Scam by Ronin exploiter?

On March 13th, 2023, Euler Finance, a DeFi project on the Ethereum blockchain, fell victim to a security breach, leading to a staggering loss of approximately $200 million US dollars to the attacker.

To complicate the investigation and evade detection, the Euler hacker transferred 100 ETH to Lazarus, the hacker group who had previously stolen over $625 million from Ronin. Lazarus then seized the opportunity to send a coded message on-chain to the Euler hacker, accompanied by a 2 ETH gift.

The message content was a hint for the Euler Exploiter to decrypt the message using eth-ecies.

Disclosure

In theory, if the Ronin Exploiter just wanted to encrypt communication in a public environment, using public-key encryption would be the simplest solution.

  • Public-key encryption: C = {rG, M + rQ} = {C1, C2}
  • Private key decryption: M = M + r(dG) − d(rG) = C2 − d(C1)

The protocol is very simple, where the ciphertext C, public key Q, private key d, random number r, and message M are used. The encryption process does not require the private key, so there is no path for private key leakage.

Was the use of eth-ecies for encryption for convenience or was there another purpose? Soon after, someone pointed out that there is a security vulnerability in eth-ecies, and the Ronin Exploiter may want to steal the private key of the Euler Exploiter.

Was this the real reason behind the message? Let us first analyze the type of vulnerability that exists in eth-ecies.

Twist Attack Vulnerability

Upon analysis, it has been discovered that the JavaScript elliptic curve library “elliptic”: “⁶.4.0” used by eth-ecies, is vulnerable to multiple security threats, including the twisted curve attack vulnerability (twist attacks). This vulnerability arises due to the failure of verifying whether the other party’s public key is on the curve when calculating the ECDH shared key. This allows attackers to construct a public key on a small subgroup curve and trick the victim into computing the shared key, ultimately leading to the compromise of the victim’s private key.

However, the exploit difficulty of this vulnerability is high and requires a very specific scenario to launch an attack. Did the Ronin Exploiter have the opportunity to launch a twist attack?

Risks with the ECDH Algorithm

ECDH algorithm is a key exchange algorithm based on elliptic curve cryptography. Similar to the traditional Diffie-Hellman (DH) algorithm, it uses mathematical operations on elliptic curves to achieve key exchange, thus providing higher security.

The steps of the ECDH algorithm are as follows:

  1. Generate an elliptic curve: Before initiating the key exchange, both parties must agree on a suitable elliptic curve that satisfies certain mathematical properties, such as the discrete logarithm problem.
  2. Generate private and public keys: Each party needs to generate a pair of private and public keys. The private key is a random number used to calculate the public key. The public key is a point on the elliptic curve, calculated from the private key.
  3. Exchange public keys: The two parties exchange their public keys.
  4. Calculate shared key: The two parties use the other party’s public key and their own private key to calculate a shared key. This shared key can be used to encrypt data in communication, ensuring the confidentiality of the communication.

For ease of description, let’s assume that Alice and Bob represent the two parties mentioned above, and G is the base point. Suppose:

Alice’s private key is a, so Alice’s public key is A = aG.

Bob’s private key is b, so Bob’s public key is B = bG.

The key to ECDH algorithm lies in the method of calculating the shared key. Using the commutative law of group multiplication, the parties can calculate the shared key as long as they have the other party’s public key.

S = aB = a(bG) = b(aG) = bA

If Alice wants to obtain Bob’s private key, she can select a curve point H with a very small order q (very few points), which is not the public key corresponding to any specific private key (but Bob does not know this). As the group is a cyclic group, when Bob calculates S’ = bH, the resulting S’ will be within this small point group. Alice does not know Bob’s private key b, but can obtain x that satisfies S’ = xH through brute force, and then b ≡ x mod q. Clearly, x is very small, at most q.

Knowing only one congruence is not enough to determine the private key, as the private key is a very large number, up to

, and a congruence in this range can have many solutions. Therefore, multiple such twisted points H need to be given to Bob for computation, so that a unique solution can be obtained through computation.

How many twisted points are needed? This depends on the order q chosen each time. The product of the orders needs to exceed the maximum value of the private key, that is, satisfy:

If a larger q is choosen each time, the number of interactions required n can be reduced, but the larger q means that the difficulty of exhaustive search increases. Therefore, a trade-off needs to be made based on Alice’s computational performance.

Event Analysis

Above, we analyzed the risks and attack principles of the ECDH algorithm. Let’s return to the eth-ecies library. In fact, it uses an algorithm similar to ECDH. It uses a temporary key when constructing the shared private key, and does not require the private key of the encryption party, so it does not pose a risk to the encryption party.

It is possible that the Ronin Exploiter may try to use social engineering tactics to guide the Euler Exploiter to use other vulnerable tools, such as the well-known PGP encryption protocol.

Coincidentally, we discovered that the widely used open-source library openpgpjs still uses a lower version of “@openpgp/elliptic”: “⁶.5.1” in its latest version, v5.7.0. What’s even more surprising is that it supports ECDH protocol based on Curve25519. The story seemed to have reached its climax, but upon analysis, we found that the ECDH protocol of openpgpjs introduces temporary keys, similar to the Ecies protocol. Even if the encryption party introduces the private key, it is only used for message signing and will not be used to construct shared keys.

With the story coming to an end, it seems unlikely that the Ronin Exploiter utilized the vulnerability in the older version of elliptic to covertly steal the Euler Explorer’s private key. As for the on-chain message, it may have genuinely been for the purpose of collaborating on a plan. Any further malicious intentions would require more advanced social engineering techniques. However, the Euler Exploiter is already aware of the situation and is staying vigilant.

Additional Information

Above, we mentioned the principles of twist attacks. However, there are still several problems that need to be solved in the actual implementation:

  1. How to construct twisted points?
  2. When Bob uses the shared key S’ to encrypt messages, he does not transmit S’ to Alice because, according to the protocol, Bob believes that Alice already knows the key. So, how can Alice obtain S’?
  3. Assuming the worst-case scenario, Alice eventually obtains a series of shared keys

What method can she use to recover Bob’s private key?

Taking the Curve25519 curve as an example, its curve equation is:

If we arbitrarily change one of the parameters, we get a new curve, such as:

We can use the sagemath mathematical software to represent it:

Then we calculate its order and factorize it:

End result:

We choose the moderately size number 19442993 and create a subgroup with 19442993 elements using the Chinese Remainder Theorem:

So here we have obtained the first twisted point, which we send to Bob as the public key, and Bob can calculate the first shared secret key:

Bob encrypted a message M using

and sent it to Alice. Alice does not know

or the message M, but she knows that M is definitely human-readable natural language. So she starts to enumerate

:

Using

, Alice decrypts the ciphertext, and if the resulting plaintext is natural language, then

=

,

.

Using the same method as above, we can obtain

. In my experiment, I used the following curves:

The final result can be represented as:

The private key b can be calculated using the Chinese Remainder Theorem:

Summary

In this article, we delved into the twisted curve attack in elliptic curve encryption algorithms through an unconventional dialogue. We analyzed the underlying cause of this vulnerability and although its exploit scenarios are limited, it is still a valuable vulnerability to be aware of. We hope our exploration inspires further learning and research in this field.

Lastly, we extend our gratitude to Safeheron, a leading one-stop digital asset self-custody service provider, for their invaluable technical guidance.

Read more: https://slowmist.medium.com/uncovering-the-twist-attack-vulnerability-was-this-a-failed-scam-by-ronin-exploiter-539111187aa6

Comments

All Comments

Recommended for you

  • Hong Kong Stock Exchange Collaborates with S&P Dow Jones Indices to Launch Co-Branded Index

    The Hong Kong Stock Exchange has announced a collaboration with S&P Dow Jones Indices to develop and launch the S&P 500 Hong Kong Stock Exchange Technology 100 Index. This index aims to measure the performance of leading companies listed in the United States as well as the largest technology companies by market capitalization listed in Hong Kong. The index is approximately 60% allocated to the Hong Kong Stock Exchange Technology 100 Index and 40% to the S&P 500 Index, with weights adjusted quarterly.

  • LeCun et al. Propose H-JEPA Hierarchical World Model for End-to-End Learning in Visual Planning

    On October 12, according to an arXiv paper, researchers Wancong Zhang, Basile Terver, Michael Rabbat, Yann LeCun, and Randall Balestriero proposed H-JEPA, an end-to-end training scheme for a hierarchical action-conditioned JEPA world model, where each layer predicts further into the future within its learned latent space. Planning is conducted top-down: the top layer optimizes the goal, and each layer's predictions become sub-goals for the layer below. When factors in the data evolve at separate time scales, higher layers discard rapid, unpredictable details while retaining slower, task-relevant states. In four simulated navigation and manipulation environments, hierarchical planning outperformed flat JEPA; in the Visual AntMaze task, a three-layer structure increased the success rate from 18% to 73%, while requiring less computational power for planning. Ablation experiments indicate that the gains come from both temporal decomposition and high-level goal representation. Under inverse dynamics supervision, this method can be scaled to real robot videos in DROID.

  • Anthropic Bans 11.4 Million Accounts in Six Months, 42000 Appeals Overturned

    On October 12, Anthropic's transparency report updated on July 23 revealed that a total of 11.4 million accounts were banned in the first half of 2026. This is significantly higher than the 1.45 million accounts banned in the second half of 2025, marking an increase of approximately 7.9 times. The statistics cover all of Anthropic's products and services without distinguishing between Claude chat and developer products. During the same period, 398,000 appeals against account bans were received, of which 42,000 resulted in overturned decisions. Based on these figures, the number of overturned bans accounts for approximately 10.6% of the total appeals. Anthropic stated that accounts may be banned for violating usage policies, terms of service, or regional support policies.

  • 2026 Nobel Prize in Economic Sciences Announced

    On October 12, the Royal Swedish Academy of Sciences announced that Robert E. Hall and Michael Woodford have been awarded the Nobel Prize in Economic Sciences. They are recognized for developing new macroeconomic models that significantly enhance the ability to implement effective stabilization policies. Based on these models, timely fiscal and monetary policy measures can reduce the peaks and troughs of the economy. Robert E. Hall and Michael Woodford received this year's award for demonstrating how to reconstruct economic models to revitalize stabilization policies. Instead of building models based on statistical relationships among macroeconomic variables such as inflation, production, and consumption, they opted to establish a foundation based on microeconomic principles. This includes understanding how the overall behavior of households and businesses influences the economy. Robert E. Hall was born in 1943 in Palo Alto, California, and earned his Ph.D. from the Massachusetts Institute of Technology in 1967. He is a professor at Stanford University in California. Michael Woodford was born in 1955 in Chicopee, Massachusetts, and earned his Ph.D. from the Massachusetts Institute of Technology in 1983. He is a professor at Columbia University in New York.

  • Amazon Plans $7 Billion Acquisition of AI Company Decart

    According to sources, Amazon is in talks to acquire the AI startup Decart, with the deal potentially valued at around $7 billion. Decart, headquartered in San Francisco, USA, has software that allows developers to switch more easily between different AI chips. As companies compete for greater computing power, this capability is becoming increasingly important. Sources indicate that if negotiations do not break down and no other bidders emerge, the deal could be finalized soon. According to private market data firm PitchBook, Decart has raised over $400 million in venture capital from investors such as Sequoia Capital, Benchmark, and Radical Ventures. In May of this year, the company's valuation was close to $4 billion.

  • Contractor for Supermicro Pleads Guilty to Illegal Transfer of Nvidia Chips to China

    Court documents reveal that a contractor associated with Supermicro has pleaded guilty to participating in a scheme to illegally transfer servers equipped with Nvidia's advanced AI chips to China. The court case records, released on October 9, indicate that external contractor Sun Tingwei (phonetic) pleaded guilty on Thursday in the U.S. District Court in Manhattan. The U.S. Department of Justice charged Supermicro co-founder Liang Yixian, Taiwan area business manager Zhang Ruicang, and Sun Tingwei in March, accusing the three of conspiring to violate U.S. export control regulations by illegally transferring approximately $2.5 billion worth of equipment utilizing U.S. AI technology to mainland China. The indictment states that the scheme began around 2024, with the three allegedly using a Southeast Asian company as a transit entity to conceal the fact that the ultimate customer was located in China.

  • Yixin Issues Apology: May Be Insolvent

    On October 12, Yixin Group published an "Apology Letter to Clients of Fixed-Income-Like Products" on its subsidiaries Ruicheng and Yirenyouxuan App. Yixin Group stated that due to the contraction of its inclusive finance and wealth management business scale and poor earnings, it has decided to completely stop the redemption of fixed-income-like products by May 22, 2026, and will strive to fairly compensate all investors through orderly exit. However, due to significant losses in multiple business areas, coupled with low asset values in market-based disposals and a lack of effective funding sources, the fixed-income-like products have effectively defaulted, for which the company sincerely apologizes to its clients. The letter indicated that after halting the redemption of fixed-income-like products, Yixin Group systematically reviewed the status of various businesses and promptly commissioned third-party institutions to conduct asset verification and financial due diligence. Preliminary findings suggest that Yixin Group may be insolvent, with a significant debt gap. The underlying assets corresponding to the unpaid fixed-income-like products are of poor quality, and efforts to seek market-based overall disposal have been unsuccessful. Legal due diligence institutions stated that they could not independently investigate the compliance of fixed-income-like products based on the transaction channels and models provided by the group. Yixin Group stated that it will further clarify its asset and liability situation, continue to stabilize its lending and other licensed businesses, make every effort to accelerate the recovery of non-performing loans, expedite the disposal and monetization of valuable assets, and communicate sincerely with clients of fixed-income-like products to resolve risks in accordance with laws and regulations, aiming for fair compensation for investors.

  • IMF Warns: AI May Have Disruptive Effects on Employment and Tax Systems

    On October 12, IMF President Kristalina Georgieva warned that AI is having disruptive effects on the labor market and tax systems, and policymakers need to rethink the education system and take immediate action to help society adapt to these changes. Georgieva stated during her debut at the IMF and World Bank Annual Meetings in Bangkok on Monday, "This is a slowly moving tsunami, but it is still a tsunami." In a session discussing the impact of AI on employment, she noted that AI has weakened demand for certain human workers by replacing a large number of repetitive, procedural jobs; at the same time, it is driving an increase in low-wage positions in industries such as construction, which she believes is "not something to celebrate." Georgieva indicated that this transformation will have profound implications for public finances, with the risk that AI may shift the economy from labor to capital, thereby undermining government tax revenues, as labor income has traditionally been a significant basis for taxation.

  • SWI Group Raises $895 Million to Transform Bitcoin Mining Facilities into AI Infrastructure

    On October 12, The Block reported that SWI Group has raised €800 million (approximately $895 million) from institutional investors following its acquisition of Genesis Digital Assets, a Bitcoin miner owned by FTX. The funds will be used to expand its AI data centers and high-performance computing infrastructure in the United States and Europe. As part of its strategic transformation, the company is repurposing suitable Bitcoin mining facilities for AI computing, gradually exiting the cryptocurrency mining business.

  • CSRC: Exploring Systems and Practices More Suitable for Innovative SMEs

    Wang Li, Deputy Director of the General Office of the China Securities Regulatory Commission (CSRC), stated at a press conference for the 2026 Financial Street Forum Annual Meeting on October 12 that over the past five years, the CSRC has solidly promoted high-quality market development. The Beijing Stock Exchange has operated safely and stably, effectively fulfilling its functions, and positive results have been achieved in market construction.