Banks got hammered yesterday after the Massachusetts Supreme Court essentially ruled that two foreclosures in the state were illegal because in the process of securitizing the loan, the foreclosing bank lost control of the actual note, and thus didn't have the standing to foreclosure.

Felix Salmon, who nobody would accuse of being pro-bank, sees a real possibility here of a systemic housing market and banking system catastrophe if this ruling is repeated in other states.

Just about everyone who has ever been foreclosed on in Massachusetts will want to confirm that the foreclosure was legal. The Supreme Court ruled that the plaintiffs should actually get their homes back, which should also strike terror into the heart of anyone who bought a foreclosed home at any point.

It just doesn't take much imagination to wargame out a disastrous situation. As Felix notes, if you got this ruling in California, then that would be endgame right there, perhaps.

While the banks may have failed to satisfy the letter of the law, this is deeply problematic justice, since from an economic standpoint, the foreclosing banks were certainly within their rights (there have been a few cases of improper foreclosures, but very few, and it's not obvious that these improper foreclosures are the same side of that coin).

With this ruling, you're left with the problem that people who didn't pay their mortgages get to keep their houses because of paperwork mistakes, which is an unjust remedy.

In December and the first four days of this year, the financial sector was smoking hot. It may have just hit a huge brick wall.

Click here to see where foreclosures are still surging >