Under terms of a contract that has been seen by Recode, whoever acquires Yahoo might have to pay Mozilla annual payments of $375 million through 2019 if it does not think the buyer is one it wants to work with and walks away.

That’s according to a clause in the Silicon Valley giant’s official agreement with the browser maker that CEO Marissa Mayer struck in late 2014 to become the default search engine on the well-known Firefox browser in the U.S.

Mozilla switched to Yahoo from Google after Mayer offered a much more lucrative deal that included what potential buyers of Yahoo say is an unprecedented term to protect Mozilla in a change-of-control scenario.

It was a scenario that Mayer never thought would happen, which is why she apparently pushed through the possibly problematic deal point.

According to the change-of-control term, 9.1 in the agreement, Mozilla has the right to leave the partnership if — under its sole discretion and in a certain time period — it did not deem the new partner acceptable. And if it did that, even if it struck another search deal, Yahoo is still obligated to pay out annual revenue guarantees of $375 million.

Who owns Yahoo would indeed be a big concern for Mozilla, whose business depends on a robust search partner and the payments it gets from them for making it the default option for users of Firefox. About 90 percent of its revenue was due to its Google deal, for example, which paid Mozilla an annual guarantee of $300 million.

So why did Mayer pay up so much more and give Mozilla such attractive rights, even though Yahoo’s ability to monetize that search traffic was so much weaker than Google’s?

Well, because she thought she could beat Google at its very best game, after years of working on search herself at the search giant. After Yahoo basically abandoned its search efforts under former CEO Carol Bartz, when it became clear that Yahoo had lost too much market share to Google and also Microsoft, Mayer felt an aggressive — and very expensive — effort was needed to get it back.

That included striking search deals with both Mozilla and Oracle to get more search volume to monetize. Mayer has also been investing enormous amounts of money and efforts into Project Index, a mobile-focused search effort that Yahoo has yet to launch.

Sources said Mayer thought she could make the Mozilla deal work better and had dreams of rolling out Yahoo search on Mozilla outside the U.S. That has not happened yet.

Mozilla welcomed the eager deal, which has been only marginally profitable for Yahoo after the payment is taken out. That’s why, quite rightly, Mozilla would now want a partner committed to search, which pretty much all the possible buyers of Yahoo do not seem to be at all, or at least not on the scale envisioned by Mayer.

Those bidders — who are in their third round of offers that range from $3.5 billion to over $5 billion — include Verizon, Quicken Loans and private equity players like TPG.

To be clear, Mozilla has the right to leave and collect its money, but it might not if it is satisfied with the buyer’s commitment to search. The company declined to comment on the contract due to confidentiality agreements.

But a spokesperson sent me this statement: "Each of our search partnerships is the result of a competitive process reflective of the value that Firefox brings to the ecosystem. The Yahoo relationship is no different."

Well, it is different and very good for Mozilla, so that deal point has been a new and unwelcome surprise to potential buyers of the company, many said. The remaining bidders only recently got details of search deals that Yahoo has struck. Besides Mozilla, Yahoo also has search agreements with Google and Microsoft.

“There is a lot of hair hidden at the company and the Mozilla payment could be very hairy,” said one buyer. Translation: Under Mayer, Yahoo has a number of potentially costly and problematic issues, kind of akin to finding out that a fixer-upper house has extensive plumbing problems.

Along with the Mozilla deal, for example, buyers estimate that there could be up to $1 billion in stock compensation costs — money owed to employees who were loaded up with shares and options in order to entice them to stay. Mayer has handed out excessively generous deals to many top execs, such as its chief revenue officer Lisa Utzschneider.

Also at issue is whether the buyers can sell the $1 billion or more in real estate that Yahoo owns, especially given the now declining values in the commercial market in Silicon Valley.

Its patent portfolio — whose worth is an ever-moving value — will also have to be sold, adding even more uncertainty.

And whoever buys Yahoo has to also deal with SoftBank and its desire to get out of large annual payments it makes to the company, which owns a big stake in Yahoo Japan. As Recode previously reported, the Japanese telecom giant wants to end the annual payments it makes that now total around $240 million and are related to fees for branding, technology and search.

Lastly, Yahoo’s core business is also declining, even as key personnel leave, such as product leader Robby Stein most recently. The company reports its latest results in about two weeks and Wall Street is not expecting much.

Hearing about the possible Mozilla costs is not going to be helpful, either.

“It’s another worrisome question mark,” said another buyer, who noted that such costs could be problematic over time, especially for those who have to explain them to public shareholders.

(If you want to read more details about Yahoo’s deal with Mozilla, this warts-and-all account by Charles Arthur is well done.)