Become a MacRumors Supporter for $25/year with no ads, private forums, and more!

Safari Being Hijacked (congratulations! Pop up)

ahostmadsen

macrumors 6502a
Original poster
Dec 28, 2009
829
473
These days, it often happens that while I'm reading something in Safari, the webpage suddenly changes to a spam page with "Congratulations! You have won..." I don't even have to click anything, it can happen in the middle of reading. It happens while I'm reading news, mostly it happens on CNN, but also while on other webpages. It only happens on my iPad, not on my Mac or iPhone.

Now, if it happened on my Mac, I would suspect a virus. But that shouldn't happen in iOS, right?
 

trsblader

macrumors 6502
May 20, 2011
439
189
It's not a virus, it's javascript someone found a way to run maliciously on those sites, commonly through the advertising scripts. Happens even on this site from time to time. It doesn't happen on your mac or iPhone because 1) You have javascript disabled 2) You didn't hit a site/article that was affected or 3) You have an add blocker installed. It has nothing to do with the OS being used.

If it's happening on a major site, report it to their staff as most have a general support forum or email. If it's happening on a shady website -- stop visiting that site. If it's happening often, I'd probably be more weary of the sites I'm using personally.
 
Last edited:
Comment

Chip NoVaMac

macrumors G3
Dec 25, 2003
8,894
31
Northern Virginia
It's not a virus, it's javascript someone found a way to run maliciously on those sites, commonly through the advertising scripts. Happens even on this site from time to time. It doesn't happen on your mac or iPhone because 1) You have javascript disabled or 2) You didn't hit a site/article that was affected. It has nothing to do with the OS being used.

If it's happening on a major site, report it to their staff as most have a general support forum or email. If it's happening on a shady website -- stop visiting that site. If it's happening often, I'd probably be more weary of the sites I'm using personally.

Thanks, but one would hope for a better solution.
 
Comment

ahostmadsen

macrumors 6502a
Original poster
Dec 28, 2009
829
473
It's not a virus, it's javascript someone found a way to run maliciously on those sites, commonly through the advertising scripts. Happens even on this site from time to time. It doesn't happen on your mac or iPhone because 1) You have javascript disabled or 2) You didn't hit a site/article that was affected. It has nothing to do with the OS being used.

If it's happening on a major site, report it to their staff as most have a general support forum or email. If it's happening on a shady website -- stop visiting that site. If it's happening often, I'd probably be more weary of the sites I'm using personally.
That is somewhat comforting, that it's not because the security of my device is broken. It used to happen all the time on one website (theguardian.com), but it stopped. Now it happens all the time on cnn.com. Presumably cnn will notice and fix their security.
 
Comment

Fenhalls

macrumors 6502
Mar 20, 2019
282
228
It's not a virus, it's javascript someone found a way to run maliciously on those sites, commonly through the advertising scripts. Happens even on this site from time to time. It doesn't happen on your mac or iPhone because 1) You have javascript disabled or 2) You didn't hit a site/article that was affected. It has nothing to do with the OS being used.

If it's happening on a major site, report it to their staff as most have a general support forum or email. If it's happening on a shady website -- stop visiting that site. If it's happening often, I'd probably be more weary of the sites I'm using personally.

Many thanks for that. Very useful information.
[doublepost=1554737298][/doublepost]
These days, it often happens that while I'm reading something in Safari, the webpage suddenly changes to a spam page with "Congratulations! You have won..." I don't even have to click anything, it can happen in the middle of reading. It happens while I'm reading news, mostly it happens on CNN, but also while on other webpages. It only happens on my iPad, not on my Mac or iPhone.

Now, if it happened on my Mac, I would suspect a virus. But that shouldn't happen in iOS, right?

Me also.
 
Comment

BruntWillows

macrumors newbie
Nov 23, 2018
6
0
The worst was when ads would take over and switch you to the app store on the page for some terrible game. I don't miss that at all.

I've had that too, wish it wouldn't (or would at least ask if you want to open it!) Even worse when you manage to close the App Store, and your page won't reload
 
Comment

Kenny99

macrumors member
Jan 28, 2018
67
10
ST. Louis, Mo.
I too have been having these. My solution is to block the sites in my router. You can get the spam website address from safari and block it in the routers url section. Meh be under security section.
 
  • Like
Reactions: Smoovejayy
Comment

Apple_Robert

Contributor
Sep 21, 2012
18,469
20,165
In the middle of several books.
These days, it often happens that while I'm reading something in Safari, the webpage suddenly changes to a spam page with "Congratulations! You have won..." I don't even have to click anything, it can happen in the middle of reading. It happens while I'm reading news, mostly it happens on CNN, but also while on other webpages. It only happens on my iPad, not on my Mac or iPhone.

Now, if it happened on my Mac, I would suspect a virus. But that shouldn't happen in iOS, right?
Adguard should solve your problem.
 
  • Like
Reactions: BorgCube
Comment

arn

macrumors god
Staff member
Apr 9, 2001
15,516
4,038
These days, it often happens that while I'm reading something in Safari, the webpage suddenly changes to a spam page with "Congratulations! You have won..." I don't even have to click anything, it can happen in the middle of reading. It happens while I'm reading news, mostly it happens on CNN, but also while on other webpages. It only happens on my iPad, not on my Mac or iPhone.

Now, if it happened on my Mac, I would suspect a virus. But that shouldn't happen in iOS, right?
I ran into this recently on my iPhone. Apparently there’s a way it gets injected in your history. I didn’t think that was possible, but that’s what I read when looking for the solution.

Deleting safari history is said to fix it. I did this and it fixed it for me.

arn
 
  • Like
Reactions: haruhiko
Comment

ahostmadsen

macrumors 6502a
Original poster
Dec 28, 2009
829
473
I ran into this recently on my iPhone. Apparently there’s a way it gets injected in your history. I didn’t think that was possible, but that’s what I read when looking for the solution.

Deleting safari history is said to fix it. I did this and it fixed it for me.

arn
Thanks, I will try this. I'm not that keen on installing adblockers, so hopefully that will work.
 
  • Like
Reactions: arn
Comment

arn

macrumors god
Staff member
Apr 9, 2001
15,516
4,038
Thanks, I will try this. I'm not that keen on installing adblockers, so hopefully that will work.
To be clear, this is going to settings -> safari -> clear history and website data

This will clear cookies and log you out of sites. But minor inconvenience.

arn
 
Comment

BeatCrazy

macrumors 68020
Jul 20, 2011
2,464
1,177
I ran into this recently on my iPhone. Apparently there’s a way it gets injected in your history. I didn’t think that was possible, but that’s what I read when looking for the solution.

Deleting safari history is said to fix it. I did this and it fixed it for me.

arn

Clearing Safari history is just a temporary fix, the hijack will come back.

iOS runs neither Java nor Flash. Just install AdGuard on all your iOS devices and be worry free.

Yeah, pretty sure he meant JavaScript. I normally wouldn't install an adblocker, but this was getting ridiculous. Put AdGuard (pro version) on my iPad + iPhone, and so far no more hijacks.
 
Comment

NewToIPhones

macrumors newbie
Apr 9, 2019
4
0
This is happening on my iPhone as well. Multiple websites, and repeatedly. Why would it be a malicious JavaScript on pages I read all the time and never had this happen before.

It's not a virus, it's javascript someone found a way to run maliciously on those sites, commonly through the advertising scripts. Happens even on this site from time to time. It doesn't happen on your mac or iPhone because 1) You have javascript disabled 2) You didn't hit a site/article that was affected or 3) You have an add blocker installed. It has nothing to do with the OS being used.

If it's happening on a major site, report it to their staff as most have a general support forum or email. If it's happening on a shady website -- stop visiting that site. If it's happening often, I'd probably be more weary of the sites I'm using personally.
 
Comment

trsblader

macrumors 6502
May 20, 2011
439
189
This is happening on my iPhone as well. Multiple websites, and repeatedly. Why would it be a malicious JavaScript on pages I read all the time and never had this happen before.

Just because you visited a page once doesn't mean a hacker will never attempt to compromise it. Would be nice if that's how the world worked though. If you type in "malicious javascript ads" to google one of the first hits is how "Tip Tier Sites" recently (at the time of the article) became targets for the first time and the images in those articles are identical to what the OP was talking about. There's also many posts from security researches talking about how this stuff works if you're interested.

That doesn't mean this is the only way. Within the past 2 years it's an extremely common way, and you can even do a forum search here on macrumors and find that this site has been attacked multiple times in the past few years.
 
Comment

NewToIPhones

macrumors newbie
Apr 9, 2019
4
0
I really don’t understand the tech stuff. I just know it’s happening on websites I visit frequently (and never had this problem before 3 days ago) and pages I visit infrequently. It started suddenly and it happens over and over now.

Any idea on how to get it to quit?
 
Comment

trsblader

macrumors 6502
May 20, 2011
439
189
I really don’t understand the tech stuff. I just know it’s happening on websites I visit frequently (and never had this problem before 3 days ago) and pages I visit infrequently. It started suddenly and it happens over and over now.

Any idea on how to get it to quit?

Stop visiting the websites or try one of the adblockers suggested in this thread. The adblockers may or may not work now or in the future
 
Comment

BeatCrazy

macrumors 68020
Jul 20, 2011
2,464
1,177
I really don’t understand the tech stuff. I just know it’s happening on websites I visit frequently (and never had this problem before 3 days ago) and pages I visit infrequently. It started suddenly and it happens over and over now.

Any idea on how to get it to quit?

You can go into Settings in iOS for Safari->Advanced and turn off JavaScript. Of course turning this off will break a lot of websites.

Alternately, an app like AdGuard Pro ($2) has stopped the hijacks for me - so far!
 
  • Like
Reactions: masotime
Comment
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.