Infected people arriving from epidemic-hit countries had not received their vaccinations
China has reported five yellow fever cases - all from people who were not vaccinated before leaving for areas with epidemics, a senior public health specialist said.
The infected Chinese workers were returning from Angola and were detected in Beijing and Shanghai, where they had connecting flights to their hometowns.
Lu Hongzhou, head of the Shanghai Public Health Clinical Center, urged stricter border quarantines and checks to help cut cross-border transmissions.
Regulations requiring vaccinations exist but "there are implementation loopholes", he said.
Yellow fever is an acute viral disease transmitted by infected mosquitoes and is mostly found in tropical regions of Africa as well as Central and South America.
Li Dexin, a senior epidemiologist at the Chinese Center for Disease Control and Prevention, said there is no cure for the infection, though current treatments help ease the symptoms, which include fever and headache.
The vaccine against yellow fever is proven safe and effective, he said, asking travelers to be vaccinated at least 10 days before their departure.
Protection can last 10 years.
Worldwide, the virus infects about 130,000 people annually and kills 44,000, according to the World Health Organization. At least 90 percent of the casualties are in Africa.