Cointime

Download App
iOS & Android

SharkTeam: Analysis of Jimbos Protocol Lightning Loan Attack Principle

On May 28, 2023, Beijing time, Jimbos protocol fell victim to a lightning loan attack, with the attacker profiting approximately $7.5 million. SharkTeam promptly conducted a technical analysis of this incident and summarized security measures, hoping that future projects can learn from it and strengthen the security defenses of the blockchain industry.

1. Incident analysis

Attacker address: 0x102be4bccc2696c35fd5f5bfe54c1dfba416a741

Attack contract: 0xd4002233b59f7edd726fc6f14303980841306973

Attacked contract: 0x271944d9D8CA831F7c0dBCb20C4ee482376d6DE7

Attack transactions: 0x44a0f5650a038ab522087c02f734b80e6c748afb207995e757ed67ca037a5eda

Attack process:

1. The attacker (0x102be4bc) borrows 10,000 ETH through flash loan.

2. Then exchange a large amount of Jimbo in the trading pool with ETH.

3. The attacker (0x102be4bc) transferred 100 JIMBO tokens to the attacked contract (0x271944d9)

4. Call the shift function of the attacked contract (0x271944d9).

5. Loop the above operation several times:

6. Finally, convert Jimbo to ETH and return the flash loan, and leave the market with a profit

Vulnerability analysis:

This attack takes advantage of the vulnerability in the JimboController (0x271944d9) contract. The shift function in it will allow the contract to perform the operations of removing liquidity and adding liquidity. When adding liquidity, the JimboController (0x271944d9) contract will send all the weth to add fluidity.

The attacker (0x102be4bc) used a large amount of weth to exchange a large amount of Jimbo coins in the liquidity pool in the second step, making the price of Jimbo in the pool very high, and then called the shift function in the JimboController (0x271944d9) contract to add liquidity Sexual operation will send all the weth in the contract to the liquidity pool (including the original weth in the contract). At this time, the number of weth in the pool increases but the price of Jimbo is still high, and the attacker (0x102be4bc) will second himself The Jimbo coins swapped out in the first step can be exchanged for weth, and the pool’s own weth and the weth sent by the JimboController (0x271944d9) contract can be swapped out together.

Summary of the incident:

The reason for this incident is that there is a loophole in the shift function of the JimboController (0x271944d9) contract. Anyone can call this function to make the contract add liquidity to the pool, and all the weth in the contract will be sent to add liquidity, regardless of No matter how the price is manipulated, the contract can be used to receive orders.

2. Security Recommendations

In light of this attack incident, we should adhere to the following considerations during the development process:

1. Exercise greater caution regarding the risk of price manipulation when developing functions related to liquidity addition and removal.

2. Prior to project deployment, it is essential to engage a third-party professional auditing team for smart contract audits.

About us

SharkTeam’s vision is to comprehensively protect the security of the Web3 world. The team is composed of experienced security professionals and senior researchers from all over the world. They are proficient in the underlying theory of blockchain and smart contracts, and provide services including smart contract auditing, on-chain analysis, and emergency response. It has established long-term cooperative relationships with key players in various fields of the blockchain ecosystem, such as Polkadot, Moonbeam, polygon, OKC, Huobi Global, imToken, ChainIDE, etc.Official website: https://www.sharkteam.org/Twitter: https://twitter.com/sharkteamorgDiscord: https://discord.gg/jGH9xXCjDZTelegram: https://t.me/sharkteamorg

Comments

All Comments

Recommended for you

  • BTC Surpasses $78,000

    Market data shows that BTC has surpassed $78,000, currently priced at $78,049.83, with a 24-hour increase of 0.04%. The market is experiencing significant volatility, so please ensure proper risk management.

  • DeepSeek-V4 Preview Version Officially Launched and Open-Sourced

    On April 24, DeepSeek announced via its official WeChat account that the preview version of the new model series DeepSeek-V4 is officially online and open-sourced. DeepSeek-V4 features a million-word ultra-long context and leads in agent capabilities, world knowledge, and reasoning performance in both domestic and open-source fields. The model is available in two versions based on size. Starting today, users can log in to the official website chat.deepseek.com or the official app to interact with the latest DeepSeek-V4 and explore the new experience of 1M ultra-long context memory. The API service has also been updated; by changing the model_name to deepseek-v4-pro or deepseek-v4-flash, users can access it.

  • Intel CEO: Semiconductor Potential Market Size Approaching $1 Trillion

    On April 24, local time, after the U.S. stock market closed on April 23, Intel officially released its Q1 fiscal year 2026 financial report and held an earnings call. The company delivered its sixth consecutive quarter of better-than-expected results, with revenue, gross margin, and earnings per share all surpassing guidance. The AI business has become the core growth engine, with a surge in demand for server CPUs and advancements in advanced processes and packaging exceeding expectations. Following this financial report, Intel's stock price surged nearly 20% in after-hours trading. During the earnings call, Intel CEO Pat Gelsinger stated that despite continuous improvements in factory capacity, demand across all business segments remains higher than supply, particularly for Xeon server CPUs, which are expected to maintain strong growth momentum over the next two years. Gelsinger also noted, 'In recent years, the focus in high-performance computing has been almost entirely on graphics processors and other accelerators. In recent months, clear signs have shown that central processing units are becoming an indispensable foundation in the era of artificial intelligence.' Looking at the overall market, Gelsinger anticipates that driven by explosive growth in AI demand, the overall potential market size of the semiconductor industry is approaching $1 trillion. However, Intel's management also warned that the company still faces multiple pressures, including declining demand in the PC market, rising costs, expanding capital expenditures, and supply constraints. (Dongxin News Agency)

  • Trump: U.S. to Soon Capture Nearly 50% of Chip Market

    On April 24, U.S. President Trump declared on the 23rd that the United States will soon capture nearly 50% of the chip market, warning that chip companies that do not manufacture in the U.S. will face very high tariffs in a year and a half to two years. U.S. Secretary of Commerce Gina Raimondo stated that the U.S. previously held only 3% to 4% of the chip market while having the largest demand for chips. Under Trump's directive, the U.S. is requiring semiconductor fabs to return to domestic production, with expectations that fabs worth $1 trillion will come to the U.S. Raimondo emphasized that this is not about tech giants purchasing chips, but rather about chip manufacturing. She mentioned commitments from Micron Technology to invest $200 billion and TSMC to invest $165 billion, along with $500 billion in funds from Taiwan expected to flow into the U.S. Raimondo also indicated during a congressional hearing on the 23rd that investments in the U.S. semiconductor industry during Trump's term are expected to reach $1 trillion. (Dongxin News Agency)

  • MetaPlanet Issues Zero-Coupon Bonds Worth 8 Billion Yen to Increase Bitcoin Holdings

    On April 24, according to market news: Japan's Bitcoin treasury company MetaPlanet issued zero-coupon ordinary bonds worth 8 billion yen (approximately 53 million USD), with 100% of the raised funds allocated to increasing Bitcoin holdings, continuing the 'Japanese version of MicroStrategy' aggressive coin acquisition strategy.

  • Trump to Speak at Cryptocurrency Conference in Florida on Saturday

    April 24, White House, USA: Trump will speak at a cryptocurrency conference in Florida on Saturday. (Jin Shi)

  • Deepseek Official Website Releases deepseek-v4 API Documentation

    On April 24, Deepseek's official website launched the deepseek-v4 API and model introduction, including deepseek-v4-flash and deepseek-v4-pro. (Jinshi)

  • US Spot Bitcoin ETF Sees Net Inflow of $223.16 Million Yesterday

    On April 24, according to monitoring by Trader T, the US spot Bitcoin ETF experienced a net inflow of $223.16 million yesterday.

  • Trump States He Will Not Use Nuclear Weapons Against Iran

    On April 24, according to CCTV International News, during an event at the White House on the afternoon of April 23, U.S. President Trump told the media that he could reach an agreement with Iran right now, but he wants the agreement to be 'permanent,' ensuring that Iran never has the chance to possess nuclear weapons. Therefore, he does not want to rush. Trump stated, 'There is plenty of time,' 'there is absolutely no pressure,' and 'the real pressure is on Iran,' which is unable to restore oil transportation under U.S. maritime blockade. He added that if Iran does not want to reach an agreement, he would 'complete the remaining tasks through military means.' When asked if he would consider using nuclear weapons against Iran, Trump replied, 'No,' and stated that even without launching a nuclear strike, the U.S. has already 'completely destroyed' Iran. When pressed by reporters on why the conflict was not resolved within the initially stated 4 to 6 weeks, Trump repeatedly mentioned that the U.S. fought in the Vietnam War for 18 years, and claimed that the U.S. had actually 'militarily taken down Iran' within 6 weeks; now it is just a matter of 'both sides taking a break.' (Dongxin News Agency)

  • Web3 data and AI company Validation Cloud completes $10 million in new round of financing

     Web3 data and AI company Validation Cloud announced a $10 million financing round from True Global Ventures. The company plans to use the funds to expand its AI products and achieve seamless access to Web3 data.