Those eight people were area residents who had been reported missing.
The grave was discovered Tuesday at the El Diamante ranch in the Tres Valles region, which is on the border with Oaxaca state.
All of the bodies recovered from the grave were taken to the central forensic lab of the Veracruz state attorney general's office, officials said.
Personnel at the lab are using dental records and DNA to identify the other 23 victims. Authorities in neighbouring Oaxaca are collaborating in that effort.
Thousands of migrants headed for the US pass through Veracruz each year, and drug traffickers use smuggling routes in the state to move narcotics into Mexico's northern neighbour.
The federal government expanded its presence in neighbouring Tamaulipas state in May to fight the Los Zetas and Gulf drug cartels, which have unleashed a wave of violence in the region.
Veracruz's government has stepped up patrols along the border to prevent the cartels from moving into its territory.
The state government has been working with the army and marines to hunt down the members of criminal organisations, especially those involved in kidnappings, this year.
Veracruz, Mexico's third most populous state, has been plagued by a turf war between rival drug cartels that has sent the murder rate skyrocketing in the past few years.
The Gulf, Los Zetas and Jalisco Nueva Generacion cartels, as well as breakaway members of the once-powerful Familia Michoacana organization, are fueling the violence in the state.
The port city of Veracruz will be the site of the 24th Ibero-American Summit of heads of state and government and will host the 22nd Central American and Caribbean Games later this year.