When you take a loan, you have to pay it back in the form of interest. However to my knowledge interest rates vary over time. What legal factors are preventing the interest rates from spiking and subsequently bankrupting the individual/business?
A lot of loans are taken out on a fixed rate basis, so the rate is part of the contract and is therefore covered by contract law.
If the loan is taken out on a variable basis then in principle the rate can rise within the terms of the contract. If a particular lender tries to raise its rates out of line with the market then its customers will seek alternative, cheaper, loans and pay off their expensive loan if they can.
If rates rise sharply in general due to unusual politico-economic circumstances then those with variable rate loans can find themselves in severe trouble. For example the base rate in the UK (and therefore variable mortgage rates closely tied to it) spiked sharply in the late 80s which caused severe stress to a lot of borrowers and undoubtedly pushed some into financial difficulties.
Interest rates are market driven. They tend to be based on the prime rate set by the federal reserve bank because of the tremendous lending capacity of that institution and that other loan originators will often fund their own lending (at least in part) with fed loans.
However, there is no mandatory link between the federal reserve rate and the market rate. No law stipulates that rates cannot rise or fall. They will rise and fall as lenders see necessary to use their capital. Though a lender asking 10% interest might make no loans when others are willing to lend for 9%.
The only protection you have is that we are (mostly) economically free. As a borrower, you are protected by the fact that there are many lenders. Likewise, as a lender, because there are many borrowers. Stability is simply by virtue of the fact that one market participant with inordinate pricing will find fewer counterparties to transact.
To protect yourself from an increase in interest rates get a fixed rate loan. The loan terms: interest rate, number of payments, monthly payments will be fixed for the loan. Of course if rate for the rest of the market drops during the period of the loan, you may be able to refinance the loan. But if you can't refinance, or won't refinance, the drop in rates for the rest of the market doesn't help you.
If you want to be able to have your rate float you can get a variable rate loan. Of course it can float up, or it can float down. So you take that risk. Because of that risk adjustable rate loans start at a lower rate. If the market interest rate drops far enough many people will refinance into a fixed rate loan at a lower rate than they could have gotten at the start.
For adjustable rate loans the lender, during the application process, details how the rate is determined. It is pegged to be x% above some national or international interest rate that they don't have any control over. If that base rate moves then your loan rate may move. They also specify how often it will adjust, and the maximum it can adjust between each adjustments and over the entire life of the loan.
That rate that starts initially lower than the fixed rate loan is the enticement that many people have to pick an adjustable rate loan. Some do it because they believe they will payoff the loan before the rates get too high, or they will see enough increase in income so they can afford the higher monthly payment if rates rise. If they are wrong about these things they may find themselves in trouble.
The terms of the adjustable rate loan still have to follow the terms of the contract: the lender can't change the % offset or the source used to used to set interest rate.
There do not appear to be any specific legal measures to prevent bankruptcies. In fact, they seems to be part of the means for which rates are raised, for the consequent aim of lowering inflation.
See: The Budgetary Implications of Higher Federal Reserve Board Interest Rates by Dean Baker, Center for Economic and Policy Research.
The Federal Reserve Board (Fed) is widely expected to start raising interest rates some time in 2015. The purpose of higher interest rates is to slow the economy and prevent inflation. This is done by reducing the rate of job creation and thereby reducing the ability of workers to achieve wage gains.