That message is almost certainly fake. It's a common scam designed to scare you into clicking on a link or downloading malicious software. Here's what I recommend:
1. Don't click on anything in the pop-up message. Avoid interacting with it entirely.
2. Close the browser tab where the message appeared. If the pop-up prevents you from closing the tab, force-close the browser.
3. Clear your browser history and website data:
- On your iPhone, go to Settings ➡️Apps ➡️Safari ➡️ Clear History and Website Data.
- Confirm the action to remove cookies and cached data that might have triggered the pop-up.
4. Enable pop-up blocking
- In Settings➡️Apps ➡️ Safari, toggle ON Block Pop-ups and Fraudulent Website Warning.
If you didn't click on the pop-up, your device should be fine. Apple doesn't send virus warnings through pop-ups, so any such message is fake.
Axel F.