NEW YORK ( TheStreet) -- A recent string of housing bust lawsuits aimed at Wells Fargo ( WFC) and JPMorgan Chase ( JPM) seems to pull both lenders back into a tangled legal mess on the underwriting of mortgages and real estate-backed securities prior to the financial crisis. However, as has been the case on Wall Street for the past year, expect that Wells Fargo and JPMorgan will continue to be buffeted from the biggest legal risks of the mortgage mess as competitors like Bank of America ( BAC) remain in the stock doghouse on exposure to pending litigation such as tens of billions in liability tied to mortgages sold to government agencies Fannie Mae and Freddie Mac. While settlements on mortgage and shareholder lawsuits, in addition to conventional asset writedowns can wipe out a quarter of profit for struggling lenders like Bank of America and Citigroup ( C), the recovering earnings of Wells Fargo and JPMorgan are likely to outweigh the risks posed by recent lawsuits. Since the start of October, lawsuits from the U.S. attorney's office and the New York state attorney general have ensnarled Wells Fargo and JPMorgan respectively, pulling both banks back into the mortgage muck and forcing them to defend loans and securities underwritten during the housing boom. In its lawsuit against Wells Fargo, the U.S. attorney's office and the Federal Housing Authority are asking for a return of hundreds of millions in FHA insurance that the bank allegedly claimed on shoddily underwritten loans. In the case of JPMorgan, New York State attorney general Eric Schneiderman, in concert with President Obama's Residential Mortgage-Backed Securities Working Group, is suing the bank for $22.5 billion in losses suffered by investors on securities underwritten by Bear Stearns, the investment bank it rescued in March 2008. In both instances, investors seem generally unconcerned by the legal risks of the suits even if headlines and allegations provide a hit to the reputation of both banks. Wells Fargo shares are off marginally since the U.S. attorney unveiled its claims of civil mortgage fraud against the lender late on Tuesday. Meanwhile, JPMorgan shares have gained since the Schneiderman and the mortgage task force opened its suit on losses tied to Bear Stearns backed mortgage securities. For Bank of America and Citigroup, legal risks and writedowns appear to pose a bigger risk. In late September, a $243 million settlement on a shareholder lawsuit filed against Bank of America for its acquisition of Merrill Lynch in September of 2008 is expected wipe out a quarter of profit and months more of capital repair for the nation's second largest lender. Citigroup's settlement with Morgan Stanley ( MS) on the value of its stake in a brokerage joint venture is also expected to create a third quarter writedown that will wipe out the bank's overall profitability and dent its capital position. Because Wells Fargo is on track for strong profitability through year-end, even a worst case scenario on litigation tied to its FHA-insured underwriting standards won't provide a meaningful hit to overall profitability. KBW bank analyst Fred Cannon calculates a settlement would shave just 5 cents from Wells Fargo's 89 cents in forecast fourth quarter earnings per share.