Carpenter, who was sent to an area hospital for further evaluation, was injured after trying to check his swing.
Carpenter was undergoing an MRI postgame and was unavailable for comment following the game, a 7-5 loss. The team was preparing for the likelihood of putting Carpenter on the disabled list and calling up a bench player from Triple-A Memphis.
Without offering a prognosis, manager Mike Matheny said he had a "high level of concern."
Cardinals outfielder Tommy Pham injured his oblique muscle on Opening Day and missed a little over a month.
"I've felt that injury. I've seen it," Matheny said. "It can be tough, but we're not going to make any conclusions until we hear from the people who know what they're talking about."
Carpenter, who was named to the All-Star team by NL manager Terry Collins on Tuesday, clutched his right side and shook his head after trying to check a swing on a 3-and-1 pitch from Jeff Locke. He was examined briefly on the field by a medical trainer before walking off with the trainer and manager Mike Matheny. He was replaced by Kolten Wong, who inherited a 3-and-2 count and popped out on the next pitch.
A three-time All-Star, Carpenter leads the National League with a .991 OPS. He suffered a similar injury in 2012 and was forced to miss a month of action with a strained right side.
If Carpenter is unable to play in Tuesday's All-Star Game, possibilities to replace him are San Francisco Giants shortstop Brandon Crawford and Cardinals shortstop Aledmys Diaz, who hit his 12th home run one batter after Carpenter left the game.
The Cardinals' infield is becoming rapidly depleted. Third baseman Jhonny Peralta left Tuesday's game and was unavailable to play Wednesday because of discomfort in the same left thumb he had surgery on in March. The Cardinals are hopeful Peralta can return to play Thursday or Friday.
Additionally, first baseman/outfielder Brandon Moss went on the disabled list Tuesday with a sprained ankle.
The team also put backup catcher Brayan Pena on the DL before Wednesday's game because of inflammation in his surgically repaired left knee. The Cardinals purchased the contract of catcher Alberto Rosario from Triple-A Memphis.