Is the stock market surge of 2023 running out of steam? That seems to be the case. The S&P 500 has retreated from the lofty levels of just a couple of months ago.

But there are some stocks that should still have plenty of room to run. Here are three stocks to buy in October that could soar more than 40% over the next 12 months, according to Wall Street.

1. BioNTech

BioNTech (BNTX 0.58%) has turned in a dismal performance so far this year. The biotech stock is down more than 30%, mainly due to declining sales of the COVID-19 vaccine it co-markets with Pfizer

Wall Street definitely hasn't given up on BioNTech. The average analysts' price target reflects an upside potential of 56%. Granted, not every analyst is all that bullish about BioNTech. However, seven of the 17 analysts surveyed by Refinitiv in August rate the stock as a buy with four others recommending it as a strong buy. 

It's possible that a resurgence of COVID-19 could boost BioNTech's vaccine sales this fall and winter. Still, CFO Jens Holstein acknowledged in the company's second-quarter update that there's "some uncertainty" about revenue. 

The main reason to consider buying the stock now, though, is its pipeline. BioNTech is evaluating BNT316 in a late-stage study targeting non-small cell lung cancer. The company teamed up again with Pfizer to develop a seasonal flu vaccine, which is also in late-stage testing. Its pipeline features a long list of promising experimental therapies in phase 1 and phase 2 clinical studies as well. 

2. PayPal Holdings

Any momentum that PayPal Holdings (PYPL 2.90%) had earlier in 2023 is now completely gone. The fintech stock has fallen nearly 20% year to date. And that decline comes on the heels of a 62% plunge in 2022.

Wall Street thinks that PayPal is poised to rebound in a major way. The consensus price target for the stock is 48% above the current share price. Of the 44 analysts surveyed by Refinitiv in September, 18 of them view PayPal as a buy with 14 rating the stock as a strong buy. None recommend selling the beaten-down stock. 

PayPal appears to be dirt cheap after its huge sell-off. Shares trade at only 10.1 times expected earnings. The valuation is even more attractive factoring growth into the equation, with a super-low price-to-earnings-to-growth (PEG) ratio of 0.48.

You might think that with its dismal stock performance and bargain-basement valuation PayPal would be struggling financially, but it isn't. The company's revenue jumped 8% year over year in Q2. Its non-GAAP earnings per share soared 24%. PayPal's guidance projects full-year non-GAAP earnings-per-share growth of around 20%.

3. Brookfield Infrastructure   

Brookfield Infrastructure (BIP -0.80%) (BIPC -1.04%) was riding high not long ago. By mid-July, units of the company's limited partnership (LP) were up more than 20% year to date. Investors didn't like Brookfield Infrastructure's Q2 results, though, causing those gains to evaporate.

There's nonetheless plenty of enthusiasm about Brookfield Infrastructure on Wall Street. The consensus 12-month price target for the LP is more than 40% higher than the current price. Even the most pessimistic analyst thinks Brookfield Infrastructure could rise by 17%.

I'm totally on board with Wall Street. Brookfield Infrastructure has a diversified portfolio of infrastructure assets, including cell towers, data centers, pipelines, rail, and toll roads. The company should be able to continue delivering solid long-term returns by using its profits to reinvest in new assets. 

Income investors will probably love the stock. Brookfield Infrastructures has increased its distribution for 14 consecutive years. More hikes are likely on the way with the company's reasonable payout ratio of 68%. The infrastructure leader's distribution yield currently tops 5.2%.