It's safe to say Bank of America (BAC 0.45%) has seen better days. Besides the abysmal performance of its shares this afternoon -- they're down more than 3% as I write -- the nation's second largest bank by assets received an unwelcome kick in the trousers courtesy of the New York court of appeals.

The ruling is part of a long-simmering dispute between the bank and mortgage-bond insurer MBIA (MBI -0.16%). In short, MBIA claims that B of A (or, more accurately, Countrywide Financial, which B of A acquired in 2008) duped it into insuring a slew of multi-billion dollar mortgage-backed securities that were collateralized by faulty mortgages. B of A said it didn't, or rather, that even if it did, it shouldn't have to compensate MBIA for all of the claims the latter paid out to holders of the disputed MBSes.

The case was in front of the appeals court after B of A challenged a number of the trial court's rulings. The most important of which was a holding that MBIA didn't have to prove that defects in the mortgage origination process had led borrowers to default on the loans -- this issue is known as "loss causation." What B of A has been arguing all along is that most of the mortgage defaults over the past few years were caused by the economic downturn and not by any alleged deficiencies in the origination process. Suffice it to say, if this theory were adopted by the court, B of A's damages would be significantly less.

A second but similarly critical issue is whether or not B of A need only repurchase loans from MBSes insured by MBIA if the loans are in default. MBIA claims that the bank must repurchase all loans that were originated in a defective manner regardless of their current status. It's B of A's position, on the other hand, that it should only be required to repurchase defectively underwritten mortgages that are already in default.

While the maximum damages in this particular case are easily digestible by B of A -- they're purported to be upwards of $3 billion -- the problem is that adverse rulings on issues like these could influence judges in other cases involving analogous claims against the bank. And those cases, mind you, could expose B of A to literally tens of billions of dollars in additional damages. In fact, as Reuters' Allison Frankel recently discussed, two federal judges have already cited the MBIA case for precedent that so-called monoline insurance companies like MBIA need not establish a causal link between underlying loan defects and defaults.

This is why yesterday's ruling in MBIA's favor on both of these issues probably wasn't wildly celebrated by B of A's executives. On the loss causation issue, the appeals court affirmed the lower court without discussion. This makes it pretty clear that banks can no longer "point to external factors like the housing bust to excuse deficiencies in underlying mortgage loans," said Frankel.

And on the second issue, the court found that MBIA is "entitled to a finding that the loan need not be in default to trigger [B of A's] obligation to repurchase it. There is simply nothing in the contractual language which limits [B of A's] repurchase obligations in such a manner." Consequently, in order to recover damages, MBIA is only required to show that it was fraudulently induced by Countrywide to write insurance on MBSes that were riskier than it had been led to believe. While this is still a considerable hurdle, it's one less hurdle MBIA must jump.