For some Florida residents, the price of getting out of foreclosure will include taking on a second mortgage  payable this time to their lawyers.

The new mortgage, which takes effect only if the foreclosure is dismissed and the homeowner’s debt to the bank is reduced, is controversial among defense lawyers, some of whom call it “creepy” and “crass.” Yet even they acknowledge it offers a solution to a vexing question: How do they get paid?

After recent revelations that banks were sloppy in processing many foreclosures and in some cases lack standing to seize a house, potential clients seeking to challenge their lenders are flocking to lawyers. But while these distressed homeowners might have a case, they generally lack the resources to pay legal fees. Being in foreclosure usually means being broke.

“We thought, ‘Why don’t we use a bit of ingenuity to find an affordable way to represent them?’ ” said Peter Ticktin of the Ticktin Law Group in Deerfield Beach, Fla. “It’s a new model, a new paradigm.”