If the residential property you are renting goes into foreclosure and is sold at an auction, the old owner will have to refund your deposit to you, or transfer the deposit to the new owner, who will now be responsible for your security deposit.