As the stock market bounces back strongly toward all-time highs, investors probably wonder if there are any bargains left in the tech sector. One way to find hidden gems is to focus on stocks with the highest difference between their current price and analyst price target, then do additional due diligence to see if they are worthwhile investments.

Therefore, let's check in on three stocks -- Qihoo 360 (NYSE:QIHU), salesforce.com (NYSE:CRM), and Facebook (NASDAQ:FB) -- that still might have some massive upside potential in this frothy market.

Qihoo 360: 147% upside potential
Qihoo 360, the second-largest search engine in China, has had a rough year. Qihoo's market share in page views (according to CNZZ) rose from 10.4% at the start of 2013 to 29% in August, but its stock plunged 29% over the past year. During that time, rival Baidu's (NASDAQ: BIDU) market share fell from 71.7% to 56.3%, yet its stock soared 34%. 

Stifel Nicolaus reiterated its price target of $168 on Qihoo 360 in late August, suggesting the stock could rise 151% from its Oct. 23 price of around $68 per share. To determine if Qihoo 360 can live up to those expectations, investors must understand why Baidu rallied.

Baidu reported strong top and bottom-line growth over the last two quarters, thanks to its increased investments in mobile platforms. That caused its revenue per online marketing customer to soar 50.3% between 2013 and 2014, offsetting lost revenue from Qihoo's market share gains. More importantly, while Baidu's margins have declined over the past few years, they have consistently crushed Qihoo's:

BIDU Operating Margin (TTM) Chart

Source: YCharts.

This indicates Qihoo sacrificed margins to gain market share. Last quarter, the company attributed its margin declines to higher marketing and promotional expenses, personnel-related spending, and bandwidth and equipment depreciation costs.

The decision to invest in Qihoo boils down to a single question: Will gaining market share against Baidu help its business by boosting its top line, or will it crush its margins instead?

salesforce.com: 28% upside potential
Salesforce's stock has only risen 5% over the past 12 months, but analyst expectations remain high. Goldman Sachs gave the stock a price target of $74 in late August, suggesting 28% upside potential from its Oct. 23 price of around $58 per share.

Salesforce's core business is cloud-based customer relationship management, or CRM, software for businesses. Last quarter, subscription and support revenue soared 37% year over year to $1.23 billion, accounting for 93% of its top line. While that top-line growth looks great, the company hasn't squeezed out a generally accepted accounting principles-adjusted net profit since fiscal 2011.

CRM Revenue (Quarterly) Chart

Source: YCharts.

The good news is that Salesforce remains the top dog in the CRM market. According to Gartner, Salesforce controlled 16.1% of the global CRM market in 2013. Its closest competitor, SAP, controlled 13%. Oracle, Microsoft, and IBM trailed with even smaller slivers of the sector, while 50% of the market remains fragmented between smaller competitors. The CRM market also grew 13.7% year over year to $20.4 billion in 2013, and is expected to become a $36 billion industry by 2017.

If Salesforce can maintain strong revenue growth while increasing its market share in cloud-based CRM platforms, the company could eventually become profitable and its stock could hit fresh highs. On the other hand, if big competitors such as IBM start consolidating the fragmented pieces of the CRM sector to gain market share, Salesforce's expenses could rise as it markets more heavily and slashes costs to remain competitive.

Facebook: 25% upside potential
Facebook, which has soared 55% over the past 12 months, received a price target of $100 from Jefferies in late July, representing 25% upside potential from its Oct. 23 price of around $80 per share.

The bull case for Facebook is simple. Advertising revenue could continue rising at high double-digit rates as the company shifts focus toward mobile and video ads. Meanwhile, its dominant position as the world's largest social network will keep advertising revenue flowing.

Quarter

3Q 2013

4Q 2013

1Q 2014

2Q 2014

Ad revenue

$1.80 billion

$2.34 billion

$2.27 billion

$2.68 billion

YOY growth

66%

76%

82%

67%

% from mobile

49%

53%

59%

62%

Source: Facebook quarterly reports.

Facebook has also done remarkably well at converting its desktop users into mobile users. Last quarter, its mobile monthly active users rose 31% year over year to 1.07 billion, or 81% of all of MAUs. Facebook's margin expansion was also impressive -- it reported GAAP-adjusted operating margin of 48%, up from 31% a year earlier. Facebook's forward P/E of 38 is also surprisingly lower than other social networking stocks. By comparison, Twitter and LinkedIn have forward P/Es of 139 and 74, respectively.

The bears' main argument against Facebook is that its user growth will eventually flatline as younger users flee to other social networks and messaging platforms. However, investors should remember that Facebook is retaining a lot of these fickle users through Instagram and WhatsApp, which could evolve into the company's second and third pillars of growth.

Leo Sun owns shares of Facebook. The Motley Fool recommends Baidu, Facebook, and Salesforce.com. The Motley Fool owns shares of Baidu, Facebook, International Business Machines, Microsoft, and Oracle. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.