Banks were dealt a big blow on Friday after a Massachusetts top court ruled Wells Fargo (NYSE:WFC) and US Bancorp (NYSE:USB) didn't have the right to foreclose on a pair of homes because they securitized and repackaged the mortgages. 

The ruling impacts the broader financial industry because virtually all big banks slice mortgages up and sell them back to investors. Some analysts believe that if other courts agree with Massachusetts, it will also create a great deal of uncertainty about who actually owns the mortgages, potentially leaving Congress to step in and clarify.

Underscoring the concern about the ruling, shares of big banks like Bank of America (NYSE:BAC) and JPMorgan Chase (NYSE:JPM) retreated on Friday, dragging down the broader markets. 

The slide came after Reuters reported Massachusetts’ highest court voided foreclosures on two homes because Wells Fargo and US Bancorp failed to show they held the mortgages at the time they tried to seize the properties. The decision upheld a lower court ruling against the big banks.

Wells Fargo felt the most immediate pain from the ruling, with its stock falling 2.30% to $31.42.  After sliding more than 2%, U.S. Bancorp was off 0.72% to $26.10.

The market reaction to the Massachusetts ruling also weighed on the broader markets, with the Dow Jones Industrial Average slipping nearly 100 points in the wake of the decision.

In a worst-case scenario for the banking industry, the ruling means banks won't be able to foreclose on homes unless they can prove under new standards they are the actual title owners. That would be an expensive proposition because banks would then have to buy back securitized mortgage packages to reacquire the title. 

If all the courts agree with the Massachusetts decision, the banking industry’s exposure could be roughly $500 billion, according to Dick Bove, an influential banking analyst at Rochdale Securities. He said 95% of all $10 trillion of home loans that could potentially be bought back would be immediately resold, leaving banks on the hook for the remaining $500 billion of bad loans.

Bove also believes the ruling has the potential to create confusion about who actually owns foreclosed homes.

“Who really gets screwed on this thing? If you bought a foreclosed home you are totally [screwed] because you don’t own that home anymore,” said Bove.

Others believe the decision does not address who owns the home.

“It's not saying that no one owns the mortgage and that no one has the right to foreclose. It's simply saying that the final beneficiary -- in this case, the securitization trust -- did not get adequate title transferred to it,” Charles Whitehead, a law professor at Cornell, wrote in an email. “Of course, that is a problem for the securitization investors and the trust.”

At the end of the day, this means the mortgage originator may be liable for not properly transferring the note, Whitehead said. The law firm or firms (and their insurers) that decided the transfer was legal may also be “on the hook for passing on the validity of the sale,” he said.

In any case, lawmakers may have to step in to clarify the securitization law so it's clear who the specific owner is.  Mortgage transfers are governed by state law and the law is not consistent across the country, meaning there may be a need for a federal fix.

“There’s got to be a clarification of the law. It may even take an act of Congress to clarify who owns these homes,” said Bove.

Congress may be loathe to take up the issue because it “will be painted as a way to force foreclosures, rather than as a way to free up the property for resale to someone else – which is probably a more accurate description,” said Whitehead.

Whitehead also said he believes this decision will slow down the resale of homes because in many cases the paper note has been lost or misplaced and in many states the evidence of ownership is a physical document. 

“We are seeing property law, whose tenets are based in centuries' old cases, running into the Internet/electronic transfer age,” said Whitehead. “Until there is a statutory fix, the common law of property can result in decisions like” the one in Massachusetts.

The Massachusetts ruling comes after all 50 states opened an investigation last year into whether hundreds of thousands of foreclosures were documented correctly during the housing crisis.