Very generally speaking, a foreclosure of the property in which the unit is located will not affect the lease. After foreclosure begins, the tenant should continue to pay rent in the same manner as before. When the foreclosure is complete and the title to the property passes, the tenant will get notice saying to whom and how to pay rent in the future
During the course of the foreclosure, a receiver may be appointed by the court to oversee the management of the property. If this happens, the tenant will be notified and should then comply with the court order.
Occasionally the foreclosing lender will want to terminate a lease prior to its expiration. Generally, the lender will be able to accomplish this by sending the proper notices of foreclosure to the tenant. If this should happen and the lender does not contact the tenant to reconfirm the lease, the lease will end when title to the property passes. Note that a lease that is recorded prior to the mortgage cannot be affected by the foreclosure. This is a very uncommon occurrence.
Although the issue is not resolved in Colorado, a majority of other states holds that a successor landlord, that is, the new owner of the property who gets title by foreclosure, is generally not responsible for the return of the tenant's security deposit unless the new landlord actually received it from the prior owner. The tenant must look to the original landlord for the return of the security deposit.