Submitted by Koolex, also found by Arabadzhiev and rvierdiiev
The borrower can borrow SOL from the lender without backing it by a collateral. This is possible because the borrower can open two positions at the same time (same TX) but link both addCollateral to one position. Although borrow checks the existence of addCollateral, it doesnt check if the positions match.
This can be done as follows:
Check the PoC below, It demonstrates how a thief could perform the scenario above.
Please create a file  tests/poc_extract_col_and_sol_lavarage.spec.ts) , then run the following command:
You should see the following output:
Summary of balances:
Test file:
On borrow validate that the TradingOpenAddCollateral has the relevant position account.
Invalid Validation
piske-alex (Lavarage) confirmed
