People who have had shingles are at a higher risk of having a stroke or heart attack later in life, according to a study CNN reported.

Shingles is a viral infection that causes a painful rash. It is caused by herpes zoster, the same virus that causes chicken pox, according to the Centers for Disease Control and Prevention. After people recover from chickenpox, the virus stays dormant in the nerve roots, and sometimes reactivates years later as shingles.

"Anyone with shingles, and especially younger people, should be screened for stroke risk factors," lead study author Dr. Judith Breuer of the University College London said in a statement.

In their study, researchers found that people aged 18 to 40 who had shingles were more likely to have a stroke, heart attack or transient ischemic attack, also known as warning stroke, than people who had not had shingles.

Researchers examined more than 105,000 people who had shingles and more than 213,000 people who had not. They used a United Kingdom database to review the participants' records for an average of six years after the shingles diagnosis and for as long as 24 years for some participants.

Based on the study, people younger than 40 years old were 74 percent more likely to have a stroke if they had shingles. Researchers also found that they were 2.4 times more likely to have a warning stroke if they had shingles and 50 percent more likely to have a heart attack.

The risk of heart attack or stroke was not as great for people older than 40 years old who had shingles. Patients were patients were 15% more likely to have a warning stroke and 10 percent more likely to have a heart attack, CNN reported.

Breuer said that better screening and treatments for stroke risk factors, including diabetes, high cholesterol and high blood pressure, may explain why older people are at a lower risk of stroke and heart-related events following shingles.