According to Web3 network security company Ancilia, the root cause of the attack on the NFT lending protocol ParaSpace occurred in the function scaledBalanceOf() of the contract 0xddde38696fbe5d11497d72d8801f651642d62353, which is used to calculate the user’s collateral through the supply() function. However, scaledBalanceOf() can be made to return a large value by manipulating the number of APE tokens in the function getPooledApeByShares(). Users can hold a large amount of collateral and use it to borrow more assets. Specifically, the hacker flash loaned 47,111.35 WSTETH from Lido.fi, created a new contract and borrowed 1.84 million APEs with about 6,000 WSTETHs as collateral, and then transferred 1.84 million APEs to the original attack contract 0xc181. The 0xc181 contract called 1.84 million APE is used to mint 1.84 million derivative tokens cAPE. This step is repeated 8 times until cAPE is depleted. The hacker spent 1334 ETH in exchange for 491,166 APEs, called withdraw(1.84M) to obtain an additional 1.84 million APEs, and currently holds about 2.3 million APEs. In the ParaSpace compound protocol, the hacker will call scaledBalanceOf() to check the user's collateral before lending the asset. However, thanks to the price manipulation vulnerability, hackers borrowed even more money. Ancilia is currently awaiting a response from the ParaSpace team on the technical analysis.