Everyone who has ever suffered from a bad fever knows it's a miserable experience. But according to a recent study published in the journal Scientific Reports, that's precisely what astronauts in space experience during exercise—and the phenomenon could be a major roadblock for sending humans to Mars.

"This is potentially dangerous," co-author Oliver Opatz, who studies how the body behaves in extreme conditions at the Center for Space Medicine Berlin at the Charité Medical University Berlin, told Space.com. "The systems in the body—the blood, the enzymes and the transmitters—don't work as they do when the body temperature is normal. When you have fever, you don't feel well, [and] your brain doesn't work as normal." Exercise is critical to staying healthy during spaceflight, so figuring out a way around this problem will be crucial for NASA's exploration agenda, including missions to Mars.

Before the team could even begin collecting data, they had to design a new temperature monitoring system that would give them reliable measurements over a long period of time—and not interfere with the astronauts—even in space. They came up with a new type of sensor that rests on the forehead. Then they equipped 11 astronauts with the sensors before, during and after their flights.

The study found that even when the astronauts weren't doing anything strenuous, their body temperature gradually crept up during the course of their stay in space, up to 100.4 degrees Fahrenheit or almost two degrees warmer than usual after 10 weeks. That could cause headache, cramps, dizziness and digestive issues.

The team thinks a few factors contribute to the constant low-grade fever, including that astronauts' body clocks are thrown off by being exposed to 16 full sunrise/sunset cycles during a 24-hour period as they orbit Earth. Other factors may include the stuffiness of the space station, which can make it harder for a body to cool itself off, and that microgravity redirects blood throughout the body.

Read more: NASA Put Dangerous Bacteria on a Satellite to Find Treatments for Future Space Travelers

But the researchers were most concerned with what happens during the astronauts' lengthy exercise sessions. The microgravity conditions astronauts experience on the space station can lead to muscle and bone loss, which is counteracted by exercising about two hours a day. The study authors say they hope the regimen can be adapted to keep temperatures lower without losing the benefit of exercise.

That will only become more necessary, as space station visits are much shorter than the journey NASA most desperately wants to take in the long run, to Mars. The longest-ever space station stay to date was 340 days; the most a single astronaut has ever clocked in multiple visits is 667 days. NASA is considering crewed Mars missions that would take either about a year—giving humans just a few weeks on the surface—or about three years total, longer than any previous human space voyage.