(HealthDay)—One-quarter of U.S. middle and high school students say they've been exposed to potentially dangerous secondhand e-cigarette vapors, a federal government study shows.

E-cigarette vapors can contain harmful substances such as nicotine, according to the U.S. Surgeon General. E-cigarette devices can also be used for marijuana and other illicit drugs.

Researchers from the U.S. Centers for Disease Control and Prevention analyzed data from the 2015 National Youth Tobacco Survey. They found that more than 24 percent of middle and said they had been exposed to vapors in an indoor or outdoor location at least once in the previous 30 days. That amounted to 6.5 million students.

Rates of exposure for specific groups were: almost 22 percent among males; close to 27 percent among females; 24.5 percent among Hispanics; 27 percent among whites; just over 15 percent among blacks, and close to 22 percent among other races.

Students exposed to secondhand smoke were much more likely to be exposed to secondhand e-cigarette vapors than other students, 40 percent vs. 8.5 percent.

Rates of exposure to secondhand e-cigarette vapors were almost 67 percent among current e-cig users, 29 percent among former users and 16.4 percent among teens who never used e-cigs.

Exposure rates to e-cigarette vapors were 51.5 percent among current tobacco product users, just over 32 percent among former users and close to 17 percent among students who never used tobacco.

The study was published March 20 in the journal JAMA Pediatrics.

"We know that secondhand e-cigarette aerosol is not harmless," said study co-author Brian King, deputy director for research translation in the CDC's Office on Smoking and Health.

"It's critical to protect our nation's youth from this preventable health risk," he said in an agency news release.

Study lead author Teresa Wang said, "To protect youth from both secondhand smoke and secondhand aerosol, smoke-free policies can be modernized to include e-cigarettes." She is an epidemic intelligence service officer at the CDC.

"These policies can maintain current standards for clean indoor air, reduce the potential for renormalizing tobacco product use, and prevent involuntary exposure to nicotine and other emissions from e-cigarettes," Wang said.

More information: The U.S. National Institute on Drug Abuse has more about e-cigarettes.

Journal information: JAMA Pediatrics