Your concern is well-founded. This is an extremely complex issue that many bankruptcy attorneys miss. Unfortunately, there is no bright line rule. The timing of when to file your bankruptcy in relation to a foreclosure or short sale (before, during, or after the bankruptcy) can be critical. Determining the best course of action for you requires the analysis of a very competent tax attorney who has strong knowledge of bankruptcy law. This is particularly true when you're dealing with a "second" home (rental properties, etc.). The primary issue is capital gains which accrue upon the sale (foreclosure, short, or otherwise). The bankruptcy will discharge the underlying debt to the mortgage lender, but you could end up owing substantial taxes depending, of course, on the gain (if any) from the sale, what deductions you have available, etc.