Nevermind Alibaba, there's another reason for Yahoo's rally

What's Yahoo really worth?

Yahoo has been on a tear recently. What shareholders might not realize: They have more to thank than Alibaba's share price.

Shares of Yahoo have risen by more than 20 percent in the last 10 days, reaching the highest level since the dotcom bubble in 2000. The most obvious explanation is a 13 percent rise in shares of Alibaba over the same period.

After all, investors generally acknowledge that the Chinese e-commerce company accounts for the majority of Yahoo's market capitalization. Yahoo continues to own a 15 percent stake in Alibaba, having sold some of its shares in Alibaba's September IPO.

But Alibaba's share-price gain only tells part of the story. Using Yahoo's own disclosures, it's possible to calculate that it holds about 0.393 shares of Alibaba for every one of its own shares. That number allows you to calculate the theoretical rise in the value of Yahoo's Alibaba stake. Since Oct. 16, the value of the Alibaba stake has risen by $4.54 per Yahoo share. That accounts for a little more than half of the $7.82 per-share gain in Yahoo's stock.

Marissa Mayer
Jason Alden | Bloomberg | Getty Images

What explains the remaining $3.28 move? Yahoo also owns a 36 percent stake in Yahoo Japan, but that company's stock has traded flat in the last 10 days.

Read MoreStarboard's real plan: A Yahoo Inc. without Yahoo

That leaves two likely explanations. One is that investors have assigned a higher valuation to the core Yahoo business, which is mainly search and display advertising. Yahoo recently came under fire from activist investor Starboard Value, which criticized the company for spending too much on fruitless acquisitions and a bloated cost structure.

Yahoo CEO Marissa Mayer last week defended the company's strategy during a quarterly earnings call. In her presentation, she pointed out the value of many small acquisitions Yahoo has made and highlighted office closures and the elimination of contract workers. Some investors may have begun to think the company will embark on a shareholder-friendly strategy around the core business.

Another possibility: Investors have begun to give Yahoo more credit for the potential to divest its Alibaba and Yahoo Japan stakes without paying taxes. On Yahoo's conference call last week, CFO Kenneth Goldman sounded encouraged about selling Alibaba without incurring a tax bill. "I have used the word 'optimistic' and I'll stick with the word 'optimistic' that we can effect a structure that makes good economic and tax sense," he said.

The tax bill could make a huge difference in how investors value Yahoo. Starboard estimated in its letter to Yahoo that a tax-free divestment of the Alibaba and Yahoo Japan stakes could save the company $16 billion. Similarly, Piper Jaffray estimated in a note last week that the company's sum-of-the-parts valuation is $56 per share assuming no taxes versus $41 per share with a 38 percent tax rate.

Read MoreActivist's plan aims to save Yahoo $16B in taxes

There remains a question over when Alibaba could be divested. Yahoo has agreed to a one-year lockup preventing it from selling its Alibaba stake through next year, though Starboard's plan may be able to avoid such a restriction, according to a person familiar with the matter. Yahoo and Starboard declined to comment.

In any event, Yahoo's recent price action suggests that there's more than Alibaba's stock to watch closely. The company's tax bill has also become a moving target.

Cramer's Stop Trading: Yahoo & Alibaba