August 1, 2023
|
Cover image for "Palmswap, Biswap, LibertiVault: When Price Curves, Permissions, and Reentrancy All Break"

Palmswap, Biswap, LibertiVault: When Price Curves, Permissions, and Reentrancy All Break

DeFi’s weakest links were on full display: Palmswap mispriced liquidity, letting attackers print money via exchange rate asymmetry. LibertiVault let deposits reenter before supply updates, handing out extra rewards. Bamboo AI’s burn logic was price-sensitive and exploitable. And Biswap’s migrator let attackers move fake tokens to arbitrary recipients. Altogether, nearly $2.3M lost — each exploit a reminder that trust assumptions and missing guards cost real money.

In Brief

  • Palmswap lost $900K due to price manipulation.
  • LibertiVault suffered a reentrancy attack.
  • Bamboo AI got exploited due to price manipulation.
  • Biswap suffered an $865K loss due to lack of access control.

Hacks Analysis

Palmswap | Amount Lost: $900K

On July 27, the Palmswap exploit on the BNB chain resulted in a $900K loss due to a price manipulation vulnerability. The issue occurred because of an error in the PlpManager contract’s PLP token price calculation logic. The exploit contract calculated the exchange rate between Palmswap’s stable token USDP and PLP based on their liquidity. However, when adding PLP token, the rate was 1:1, and when removing PLP token, it was 1.9:1. This allowed the attacker to profit. The attacker borrowed 1M USDT and used it to mint 996,324 PLP, which were later sold at a 1.9:1 exchange rate, resulting in a profit of 901,455 USDT. The exploiter returned $721,450 to Palmswap

Press enter or click to view image in full size

Exploit Contract (on BNB Chain): 0x55252A6D50BFAd0E5F1009541284c783686F7f25

Transaction Hash: 0x62dba55054fa628845fecded658ff5b1ec1c5823f1a5e0118601aa455a30eac9

LibertiVault | Amount Lost: $450K

On July 11, the LibertiVault exploit on the Polygon chain resulted in a $450K loss due to a reentrancy attack. The root cause of the exploit was the absence of a reentrancy check in the private deposit() function. The attacker first borrowed 5M USDT through flash loans. These funds were then deposited into the LibertiVault’s contract to receive rewards. During this transaction, the attacker reentered the deposit() function before the totalSupply was updated. This allowed the attacker to mint additional coins for profit since the rewards were calculated based on the initial deposit and total token supply.

Press enter or click to view image in full size

Exploit Contract (on Polygon Chain): 0xdfcdb5a86b167b3a418f3909d6f7a2f2873f2969

Transaction Hash: 0x7320accea0ef1d7abca8100c82223533b624c82d3e8d445954731495d4388483

Bamboo AI | Amount Lost: $53K

On July 4, the Bamboo AI exploit on the BNB chain caused a loss of $53K due to a price manipulation attack. The root cause of the exploit was that the attacker was able to reduce the BAMBOO token supply by burning tokens, artificially increasing the token price. The attacker initially borrowed 4,042 WBNB using flash loans and swapped the funds for 137M BAMBOO tokens. The transfer of BAMBOO tokens triggered the burning process, reducing the total supply. The attacker then sold the BAMBOO tokens at an artificially inflated price, making a profit, and used it to repay the flash loans.

Press enter or click to view image in full size

Exploit Contract (on BNB Chain): 0xed56784bc8f2c036f6b0d8e04cb83c253e4a6a94

Transaction Hash: 0x88a6c2c3ce86d4e0b1356861b749175884293f4302dbfdbfb16a5e373ab58a10

Biswap | Amount Lost: $865K

On July 1, the Biswap exploit on the BNB chain caused a loss of $865K due to an access control vulnerability. The attacker exploited Biswap’s liquidity migrator contract, which had been deployed to facilitate liquidity migration from v2 to v3. The problem occurred in the migrate() function of the v3 contract, which lacked recipient validation, enabling token transfers to anyone. Additionally, the contract failed to check the validity of v2 tokens, enabling the attacker to use fake tokens to add v3 liquidity. The Biswap team acknowledged the issue and restricted access to the migrator contract.

Press enter or click to view image in full size

Exploit Contract (on BNB Chain): 0x839b0afd0a0528ea184448e890cbaaffd99c1dbf

Transaction Hash: 0xebe5248820241d8de80bcf66f4f1bfaaca62962824efaaa662db84bd27f5e47e

‍

Ready to Shift Security Assurance In-House? Talk to Our Security Experts Today.