The agency said travelers need to be vaccinated before going to affected areas, and added that people may have to plan ahead because there is a shortage of yellow fever vaccine, NBC News reported.

The outbreak in Brazil has infected more than 400 people and killed at least 40, and possibly more than 80, according to the World Health Organization.

WHO said it's the worst outbreak of the mosquito-borne disease in Brazil since 2000, and includes areas that had not been at risk of yellow fever spread in decades, NBC News reported.

"Anyone 9 months or older who travels to these areas should be vaccinated against yellow fever," the CDC alert said. "People who have never been vaccinated against yellow fever should not travel to areas with ongoing outbreaks."

The CDC also said a booster shot is not needed if people have been vaccinated once, NBC News reported.