Look at the Act's definition of the foreclosing lender. If they're the ones that got the property, then they're the "immediate "successor in interest" to the borrower/landlord, and if you're under a lease, the lender becomes your landlord and that's who you owe rent to. If you weren't under a lease and were month-to-month, same result, so you're incorrect that you have no contract with the bank, you in effect get one at the time of the foreclosure.
Your financial condition is regretable, but you don't get to live rent-free because of the foreclosure.
Disclaimer: Please note that this answer does not constitute legal advice, and should not be relied on, since each state has different laws, each situation is fact specific, and it is impossible to evaluate a legal problem without a comprehensive consultation and review of all the facts and documents at issue. This answer does not create an attorney-client relationship.