Recent accidents involving crude oil being shipped from the Bakken area of North Dakota and Montana are raising eyebrows on Wall Street and have analysts looking at companies that could be exposed to new rules governing oil shipments from the region.
Three major accidents have taken place in a short period of time: Two trains collided in Casselton, N.D., last week; a train derailed and exploded in western Alabama in November; and 47 people were killed when an oil-laden, runaway train exploded in Quebec in July.
The incidents prompted the NTSB to look into the issue and spurred a safety alert from the Pipeline and Hazardous Materials Safety Administration that said crude transported from the Bakken may be more flammable than traditional heavy crude.
Mizuho analyst John Malone said in a research note that costs related to "stricter transport standards could squeeze margins further" on oil out of Bakken.
Malone cited several stocks that had the potential to suffer as a result, including Hess, Marathon Oil, Continental Resources, Oasis Petroleum, EOG Resources, Whiting Petroleum, Nostrum Oil & Gas, Kodiak Oil & Gas and Triangle Petroleum.
New rules could produce winners, however. Jim Corridore from S&P Capital IQ noted in a research note that the potential for new regulation is "a net positive for rail car companies because they'll need to design and sell new fleets." On the flip side, it could hurt leasing companies, "because their cars won't meet regulations and therefore will be outdated."
The recent accidents heighten the debate between rail and pipeline transport of crude. Industry estimates indicate that rail capacity could grow enough to handle 700,000 to 750,000 barrels of crude a day this year—up from roughly 150,000 barrels currently.
Compare that with the estimated 700,000 barrels of crude per day that could be transported by the Keystone pipeline by 2016, according to estimates from research firm IHS, and it appears that rail is becoming the more viable option.
(Read more: US failed over Syria, Saudi prince says)
But not only might rail transport of crude be more dangerous, it's also far more expensive. Analysts estimate that shipping oil domestically by rail costs about $4 to $5 more per barrel than by pipeline—and shipping oil by rail from the Canadian oil sands to the Gulf Coast (the route Keystone would cover) would be about $7 or $8 more expensive per barrel.
Corridore said that the spate of recent rail accidents "certainly makes the case for pipelines stronger, especially because the cost to ship is so much less." But he also pointed out that pipelines' completion has been slow in coming, so their relative scarcity is an issue.
Rail will continue to benefit for years in the United States because pipelines are not moving enough oil right now, Corridore said, but he added that longer term, the energy industry will see a blend between pipeline and rail transport because "one way or another, crude will get where it needs to go."
—By CNBC's Jackie DeAngelis. Follow her on Twitter