When it comes to smartphone security, we have to be more wary than ever. As the devices become more integral to our lives, they also become more valuable targets for hackers, malware and adware. That’s why you have every right to be worried when a weird pop-up appears on your iPhone when you’re browsing the internet.

These pop-ups aren’t just annoying ads. They are scam attempts. Earlier this year, multiple iPhone users reported encountering similar pop-ups in Chrome and Safari that interrupted their web browsing with a message reading, “Congratulations, Amazon.com User” and promising a chance for a gift. These pop-ups may ask you to answer a quiz or survey, or click on a button or link to claim the fake prize.

This isn’t the only form these malicious pop-ups take. Some may warn you of viruses detected on your iPhone. To make it even more confusing, the pop-ups can appear while you’re browsing legitimate websites. Some of these scams work by redirecting you from the site you’re on to a different site. Essentially, they’re malicious ads that sneak into your browser. They even have their own nickname: "malvertising."

What are these pop-ups?

These disrupting pop-ups are usually phishing attempts. It’s a type of scam that tries to extract personal or financial information from you, or convince you to download malware. These kinds of pop-ups have famously appeared on desktop and laptop browsers in the past, but are now a problem for smartphones as well.

So, have I been hacked?

The good news is your iPhone has probably not been hacked. The signs of a hacked phone are usually much more subtle. Check out our seven clear-cut signs that your device has been hacked if you’re still concerned. The important thing is to not click on any links or buttons in the pop-up, and to especially take care not to give out any personal information. It can be alarming to see a pop-up claiming you phone has viruses, but don't let that push you into tapping on anything.

"Unless you’re confident of an ad’s legitimacy, you should avoid interacting with pop-ups or webpages that seem to take over your screen," warns Apple.

Now what?

You’re staring at a pop-up and you know you shouldn’t click on any links or buttons. The first step is to close the tab or shut down the browser entirely. "Some popups and ads have fake buttons that resemble the close button, so use caution if you try to close a pop-up or ad. If you're unsure, avoid interacting with the popup or ad and close the Safari window or tab," says Apple. If the ad hasn't completely taken over your browser, you can also just navigate away from the current page to a different site.

For your iPhone, Apple recommends going into your Safari settings and making sure the Block Pop-ups and Fraudulent Website Warning options are turned on. You can get to these by tapping on Settings, scrolling down and tapping on Safari, and then checking the toggle switches in the General and Privacy & Security sections. Make sure the pop-up and warning options are green.

Protect yourself

The makers of these malicious pop-ups are always working on new ways to get around security to deliver the fake ads, but there are some steps you can take your protect yourself and your iPhone. One of the most important things you can do is to keep iOS and your browser apps updated. For example, iOS 12.1 just came out. If your iPhone is eligible, go ahead and update to take advantage of Apple’s latest security improvements.

Legitimate companies are fighting back against malvertising pop-ups by improving web browsers and working to prevent forced redirects on both mobile and desktop systems. Hopefully, these obnoxious and potentially dangerous pop-ups will soon be a relic of our technology past. Until then, stay wary. Shut them down if you encounter them and keep your iPhone updated.

7 ways to hack-proof your smartphone to keep your data safe

Smartphones are tempting targets for crimimals, but there are steps you can take to secure your phone. Learn how updating your software and being smart about apps and passwords can protect you.