Shares of Chipotle Mexican Grill (CMG 6.33%) have surged 27% since the beginning of 2017, as investors have started to gain confidence in the company's turnaround. However, Chipotle stock is now quite expensive. It trades for 47 times the company's "stretch" 2017 EPS target of $10, and nearly 60 times the $8.15 per share that analysts (on average) think it will actually earn this year.

Not surprisingly, many investors and analysts doubt that Chipotle can live up to this high valuation. Indeed, one analyst -- Ronnie Moas of Standpoint Research -- recently told investors to sell Chipotle stock, arguing that it was trading at a valuation that only makes sense for a high-growth tech company.

The interior of a Chipotle restaurant

Bears think that Chipotle stock is massively overvalued. Image source: Chipotle Mexican Grill.

It's certainly possible that Chipotle won't produce enough earnings growth to justify its current valuation. That said, the bears are seriously underestimating Chipotle's potential -- that is, what it could realistically achieve if it can win back customer loyalty in the years ahead.

Here's how much money Chipotle used to make

Chipotle's earnings power collapsed to almost zero last year, as sales plunged and the company invested in various food safety and marketing initiatives to provide a foundation for its recovery. However, before then it had been extremely profitable.

Indeed, in the 12 months ending in September 2015 -- i.e., right before its damaging E. coli outbreak -- Chipotle earned $16.77 per share. That's more than double what most analysts expect it to earn this year.

CMG EPS Diluted (TTM) Chart

Chipotle Mexican Grill EPS Diluted (TTM), data by YCharts.

Thus, if Chipotle can just return to its previous high-water mark for EPS, the stock wouldn't seem overly expensive. It would trade for 28 times earnings -- right in line with Starbucks' valuation.

Chipotle has continued expanding

Furthermore, Chipotle has kept growing its store base in recent years, notwithstanding its financial troubles. At the time of its peak profitability, Chipotle operated about 1,800-1,900 restaurants. By contrast, it ended 2016 with 2,250 locations and it plans to open another 195-210 in 2017.

If Chipotle can get its restaurants back to their peak productivity levels over the next five years or so, Chipotle's EPS would soar far beyond its previous high.

Prior to Chipotle's food safety crisis, sales per restaurant had reached $2.5 million. Assuming that Chipotle continues opening about 200 restaurants per year, it would have more than 3,200 locations by the beginning of 2022. If those restaurants generated $2.5 million of sales, on average, Chipotle's revenue would exceed $8 billion, compared to a previous peak of less than $4.6 billion.

The sky is the limit -- but it's not a sure thing

One Chipotle bear recently said that the company would have to generate EPS of $24 to justify its current market cap. Obviously, that isn't going to happen in 2017. But in a favorable scenario, Chipotle's EPS could dramatically exceed that mark five years from now.

Menu price increases (to offset labor cost inflation) and new tools like mobile ordering and mobile payment will increase Chipotle restaurants' potential unit sales. If average unit sales reach $3 million by 2022, rather than just returning to the previous high of $2.5 million, total company revenue could reach $10 billion.

This increased scale and higher store productivity could offset cost increases related to food safety and marketing, allowing Chipotle's pre-tax margin to rebound to its pre-crisis level of 18%-19%. Meanwhile, if corporate tax reform causes Chipotle's effective tax rate to fall to 29% (from around 39% recently), the company's after-tax profit could reach $1.3 billion, or about $45/share.

It will be challenging to achieve a complete comeback like this. As my Foolish colleague Timothy Green noted earlier this year, many of Chipotle's rivals are mimicking its emphasis on "better for you" food. Chipotle is trying to educate consumers, explaining that other chains don't have the same high standards for using natural ingredients, but it's not clear how effective these efforts will be.

Another risk is that a significant segment of consumers may never forgive Chipotle for its previous food safety lapses. This would obviously put a damper on the growth that Chipotle needs to show in order to justify its lofty valuation.

Investors shouldn't blindly buy Chipotle stock thinking that it is a sure thing. That said, the company does have massive earnings growth potential. If Chipotle gradually boosts sales per restaurant to $3 million over the next five years while rebuilding its profit margin, EPS could reach $45. That would probably send the stock flying past $1,000.