When the house goes through Foreclosure; all LIENS are supposed to be paid off:
If there are undisclosed liens, and you do not get Title Insurancem you may be on the hook.
If the creditor didn't file a Lien, for example the HOA, they might come after the new owner.
In any other case, you are not taking on THEIR debt, you are creating a new debt based on the purchase price of the house, (which will be less that they owed.)
You obviously need a good Realtor representing you.
Good luck and may God bless
What the former owners owe really only matters when the bank makes the price they want for the home.