Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ahostmadsen

macrumors 65816
Original poster
Dec 28, 2009
1,109
854
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
450
204
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:

Chip NoVaMac

macrumors G3
Dec 25, 2003
8,888
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.
 

ahostmadsen

macrumors 65816
Original poster
Dec 28, 2009
1,109
854
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.
 

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.
 

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
 

Kenny99

macrumors 6502
Jan 28, 2018
289
107
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

Apple_Robert

Contributor
Sep 21, 2012
35,593
52,338
In a van down by the river
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: BigMcGuire

arn

macrumors god
Staff member
Apr 9, 2001
16,391
5,831
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

ahostmadsen

macrumors 65816
Original poster
Dec 28, 2009
1,109
854
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

arn

macrumors god
Staff member
Apr 9, 2001
16,391
5,831
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
 

BeatCrazy

macrumors 603
Jul 20, 2011
5,109
4,471
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.
 

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.
 

trsblader

macrumors 6502
May 20, 2011
450
204
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.
 

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?
 

trsblader

macrumors 6502
May 20, 2011
450
204
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
 

BeatCrazy

macrumors 603
Jul 20, 2011
5,109
4,471
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
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.