Actually, Congress is aware of this foreclosure problem in US in 2007. You are right to be concerned, because, usually the debt forgiveness by a financial institution is a taxable event!
But, the good news is that the Congress has passed the
Mortgage Forgiveness Debt Relief Act of 2007, a taxpayer will not have to pay federal income tax on debt forgiven by a lender of a homeowners principal residence.
For a full discussion of this Law, please refer to Mortgage Forgiveness Debt Relief Act of 2007 , by logging onto the following website.
H.R. 3648: Mortgage Forgiveness Debt Relief Act of 2007 (GovTrack.us)