In the past few weeks, state attorneys general and lawyers representing borrowers in danger of losing their homes have uncovered a number of certainly dubious, potentially fraudulent, practices relating to the way banks have been processing foreclosures. On Sunday HUD Secretary Shawn Donovan told Huffington Post, “The recent revelations about foreclosure processing — that some banks may be repossessing the homes of families improperly — has rightly outraged the American people. The notion that many of the very same institutions that helped cause this housing crisis may well be making it worse is not only frustrating — it’s shameful.”

The revelations, which include lost documents and lying on court records, started to surface in mid-September. But a month after the start of “Foreclosure-gate” (some people are now calling them fraudclosures) and it’s still not clear how bad or how big this scandal really is. But what is clear is that Foreclosure-gate will end up resulting in huge new losses for the banks, potentially tens of billions. Here’s how:

So just how bad is “Foreclosure gate?” To get the answer to the first part of that question I called a guy who is one of my go-to people on how banks take advantage of homebuyers, Thomas Martin. He runs something called America’s Watchdog and has long been crusading about the bogus fees that banks and title companies charge people who take out a mortgage. He’s not usually one to overlook bad behavior especially when it comes to taking advantage of borrowers. So I asked him how much of a scandal he thought foreclosure-gate was. On a scale of one to 10, he said 5, possibly 6. Yes, the banks and their lawyers may have forged documents in order to complete foreclosures on homeowners. But many of these people weren’t paying their mortgages anyway, so they were going to be in foreclosure anyway. “I recently got a call from a woman in Atlanta who has never made a mortgage payment in 5 years and she was outraged and said Chase was racist because they were trying to foreclose on her,” says Martin.

Kathleen Day at the Center for Responsible Lending would put the scandal closer to a 10. The foreclosure processes at the banks were so bad that there have been a few instances where banks have forged documents and pushed through foreclosures on houses where people have never missed a payment. But bad mistakes like that are not the point. She says that no one should have their stuff taken from them illegally. There are rules around foreclosures meant to protect borrowers. And everyone deserves the same protection under the law, even if they have been late on their mortgage.

So on the scandal scale, is this Martha Stewart or Enron? Here are the facts that we know: When the housing bubble was going up, banks made thousands of mortgage loans or often they bought loans from mortgage brokers who made them directly to consumers. Banks would then take those mortgage loans and bundle them up into bonds that they would then sell to investors, passing the monthly payments of borrowers over to these new “owners” of the mortgages. To make this all work, the banks had to file and retain paperwork that transferred the ownership of the mortgages from the original lenders to the new investors. Well, it appears the banks bungled that process, or at the very least in a number of case, in potentially many cases, they lost the paperwork. That’s part 1.

Part 2: Instead of owning up to the fact that they had messed up or lost the paperwork on thousands, maybe millions, of mortgages, the banks tried to cover it up. When borrowers stopped making payments and the banks wanted to foreclose on the properties, the banks hired low-level employees to sign and file affidavits, hundreds of thousands of them, with the courts all around the country attesting to the fact that they had reviewed the loans and could prove their employer, the banks, were the rightful owners. The only problem is that they didn’t and couldn’t. In the past few weeks, it has come out that the so-called robo-signers, who are now being questioned by authorities, knew very little about the mortgages they signed-off on or mortgages in general. Some couldn’t define the word affidavit.

At first this may look like a minor paperwork problem. So a Martha Stewart type scandal. But once you dig a little deeper you can start to construct something that seems a little more nefarious. For months, borrowers have been complaining about how difficult it is to get a bank to modify their loans. The mortgage help-lines are overwhelmed. The bank processors ask for documents two or three times. Often it’s hard to get the same person on the phone. This all seemed like a problem of system not ready to deal with the hundreds of thousands of borrowers who because of the Great Recession were suddenly having problems paying their home loans. But what if the banks were just using their “modification” attempts as a means to distract borrowers, so they wouldn’t realized they were filing phony documents at the courthouse to kick them out.

And here’s the real kicker. Some observers are now saying that the banks may have purposely lost the loan documents in order to mislead investors. The Financial Crisis Inquiry Commission recently found that the banks hired firms to evaluate the mortgages they were considering buying and found many of them unworthy–meaning there was a high chance they would default. So did the banks not buy these loans? No, instead they bought the risky loans at a discount and then passed those loans off to investors at full face value, scooping up more profits for the banks. Then destroyed the paperwork so the investors couldn’t figure out what had happened. Sound Enron-like yet?

How much will this cost the banks? Already three banks Bank of America, Ally’s GMAC and JP Morgan Chase have temporarily stopped foreclosures in many parts of the country. Analyst Paul Miller, who covers the banks at FBR Capital Markets, says reviewing and correcting the faulty mortgages will cost banks $2 billion for every month that foreclosures are delayed. He thinks the process could take the rest of the year, and puts the final bill at $6 billion.

But that’s if the banks are eventually able to prove they own the loans, and are mostly exonerated for lying to the courts. If, instead, the banks don’t have the necessary paperwork on most loans and are found to have committed widespread fraud to hide that fact, they may be forced into a mass settlement. One possibility: The banks agree to cut the loan balances for borrowers, and give that money to investors. Reducing the loan amounts would lower borrowers’ monthly payments, and also put many borrowers in a position where they no longer owe more than the house is worth. Defaults would fall, making investors happy.

Amherst Securities Group, which tracks mortgage bonds, estimates that there are $154 billion in defaulted home loans that are serviced by the banks that have come under the most scrutiny. If the banks were forced, as a settlement, to cut the loan balance on all those loans by 20%–about what the housing market has fallen so a good guess of what is needed to get many people “above water,” that would cost $30 billion. Bank of America, which services more loans than any other bank, would half to pay slightly more than half of that bill itself, or $17 billion. Would that cause another financial crisis? Probably not. With nearly $150 billion in capital in the form of common equity, BofA should be able to afford to take that hit.

But if it turns out that the banks committed widespread fraud on the investors of mortgage bonds, then we could be looking at another financial crisis. Forcing the banks to buy back all the loans they duped the investors on and are now in default or have already gone to foreclosure would cost hundreds of billions, if not trillions. The bailouts would be back.

It seems clear that we have already found out in the early stages of foreclosure-gate that the banks’ behavior was pretty bad. Let’s not hope it was as bad as some people think.

UPDATE: JP Morgan analyst Ed Reardon comes in with an estimate of $55 billion for what Foreclosure-gate may cost all the banks. My analysis looked at just banks that had already halted foreclosures. Reardon says those costs would be spread over a number of years. You can see his full report at Zerohedge.