Probably not. If you flat out asked if it was in foreclosure, and they said no, then I would say almost definitely that it is a non-disclosure and you should be allowed out of the lease with all your deposit--no questions asked. Even if you did not ask, there is a convenant in law (old school) that someone will not come knocking on your door one day and say, "get out of my house (or condo, etc.) It is called a covenant of quiet enjoyment.
What I can tell you that under Title VII, The Protecting Tenants at Foreclosure Act of 2009, is that IF the property is sold to someone and they either want to kick you out, or move in, they would have to give you 90 days notice. I can also tell you that if you want to get out of the lease, you should do it in writing and quickly or else the court will say, "you should have spoke up sooner." You could hire an attorney or represent yourself in court if you want out of the lease.
I agree with the answer provided by Mr. Bishop. I will add that I have been consulted by a few clients about this problem. It all boils down to the possibility that you will have to move from the property before the natural expiration of the lease. The landlord always had the legal ability to force you to move upon expiration of the lease, so the only real issue is whether you may have to move before the lease is up. With this new law in effect, the new owner must honor the lease unless the new owner intends to occupy the property. Most foreclosure properties are not selling at the auction and the bank ends up taking the property back. The bank must honor the lease that is in effect, since the bank cannot "occupy" the property.
This response is being provided for infromational purposes only, shall not be construed as legal advice, nor shall it establish an attorney client relationship.
The previous answers are accurate. A property owner can rent their properties even if they are in financial difficulty and facing a forelcosure. The fact that they are in trouble with the bank when the lease is signed is irrelevant if they are able to get out of foreclosure. The important fact would be whether landlord is actually foreclosed. If this happens, you have rights as stated in the previous answers (extra time to vacate the property or in certain situations the ability to ratify the lease with the new owner). Should you have to vacate the property before the end of your lease, your landlord may be liable to you for breaching the lease (failing to provide the property for the length of the lease).
DISCLAIMER—This answer is for informational purposes only and discusses general legal principles, trends, and considerations and is not intended as specific legal advice regarding your question. This answer does not establish an attorney client relationship. For legal advice, you should retain legal counsel regarding your specific circumstances.