Housebuilders Countryside and Taylor Wimpey have been told to change their leasehold contract terms by the UK competition watchdog or face legal action.

The Competition and Markets Authority (CMA) said the unfair terms, which double ground every 10 to 15 years, trap people. It said the contract means people can struggle to sell or mortgage homes. The builders said they had already taken steps that address the issue.

The CMA said it had concerns that the clauses in the contracts may break consumer protection law. They must be removed and not used again, it said.

CMA chief executive Andrea Coscelli said: "These ground rent terms can make it impossible for people to sell or get a mortgage on their homes, meaning that they find themselves trapped. This is unacceptable. Countryside and Taylor Wimpey must entirely remove all these terms from existing contracts to make sure that they are on the right side of the law."

He added: "If these developers do not address our concerns, we will take further action, including through the courts, if necessary." The watchdog is also looking into Barratt Developments and Persimmon Homes contracts.

Campaigners have called for leaseholds to be banned on new builds, and the government has said previously it would work to end the practice. Housing Secretary Robert Jenrick said unfair practices, including crippling ground rents, have no place in our housing market.

"This behaviour must end and I look forward to appropriate redress being forthcoming for leaseholders," he added. Taylor Wimpey said: "We will continue to cooperate with the CMA and work with them to find a satisfactory resolution, within the required timescale."

The housebuilder added that it stopped selling leases that doubled ground rent every ten years on new developments from 1 January 2012. In 2017 it launched a voluntary help scheme that covers the cost of converting terms so ground rents are linked to rises in the retail price index (RPI) measure of inflation and set aside £130m to cover the cost of lease conversions.

The company said that a significant number of Taylor Wimpey customers have already used this scheme and it remains open. Countryside said it had sold no properties with doubling ground rent clauses since 2017 and that it had an assistance scheme for people who charges doubled more than every 20 years. It said it would continue to engage constructively with the CMA to resolve this complex issue.

The National Leasehold Campaign (NLC), which wants to abolish new-build leasehold, said that Taylor Wimpey and Countrywide were two of the worst offenders in the leasehold scandal. NLC founder Katie Kendrick said the campaign was delighted with the CMA's stance.

However, she said that ground rents are only one of the ways for freehold investors to make money at the expense of leaseholders. "Leaseholders are navigating a feudal system that is stacked against them,” she said, “with rip-off permission fees, escalating service charges and, for many new build estates, estate management fees. The big developers could do more to provide redress for the systematic mis-selling of leasehold homes; they choose not to".