News for hackers. Stuff that matters.
Re:An iframe from googlesyndication.com tries to access the ... by veeti on Sunday December 19, 2021 @11:34AM (#29615269)
Curiously no explanation why this sort of malicious behavior is accepted by "Google Ad Manager" in the first place.

If you haven't already installed: https://addons.mozilla.org/en-US/firefox/addon/ublock-origin... https://chrome.google.com/webstore/detail/ublock-origin/cjpa...

Re:An iframe from googlesyndication.com tries to access the ... by jefftk on Sunday December 19, 2021 @11:42AM (#29615392)
I'm not sure it is allowed; that's not a part of the business I know much about. Since ads can run arbitrary JS it's hard to enforce policy programmatically.

On the other hand, it's not clear to me that whatever this advertiser is trying to do is having any real effect, aside from causing a console message that it is being blocked. Access to the mic and camera from cross-origin iframes is blocked by default, and you can't even trigger a permissions prompt.

As for installing an ad blocker, even with all the messiness of advertising, I still prefer it to paywalls.

Re:An iframe from googlesyndication.com tries to access the ... by ineptech on Sunday December 19, 2021 @11:47AM (#29615478)
> Since ads can run arbitrary JS it's hard to enforce policy programmatically.

Letting ads run arbitrary JS is the policy, right? It's not like that's a requirement to make the internet work, that's just a Google policy that trades money for user experience.

Re:An iframe from googlesyndication.com tries to access the ... by samhw on Sunday December 19, 2021 @01:08PM (#29616480)
> Letting ads run arbitrary JS is the policy, right?

I mean, anything on the Web can run arbitrary JS. The entire point is that it's a sandbox environment where arbitrary JS can't do any harm (excluding cases where vulnerabilities are found).

If you're not comfortable with arbitrary JS running on your computer, you'd have to either (a) not use the Web, (b) disable JavaScript, or (c) only visit sites which you have vetted and deem to be trustworthy. None of those are particularly practicable.

Most of us operate on the generally-reasonable assumption that the sandbox is effective, and therefore that we're OK to [click on that random link from HN like you did just now / open that news site which pulls in a bunch of tracking scripts / etc].

Either way, this is not somehow a problem that's specific to Google Ad Manager in any way at all. I don't know what else you could really expect of them.

Re:An iframe from googlesyndication.com tries to access the ... by smolder on Sunday December 19, 2021 @02:21PM (#29617325)
> (a) not use the Web, (b) disable JavaScript, or (c) only visit sites which you have vetted and deem to be trustworthy.

> I don't know what else you could really expect of them.

Your option C is basically how it must work, and mostly does. To be safe online we go to sites we trust. When Google delivers malicious JS through ads, the site operator probably doesn't know Google has harmed the user on their behalf, so their trustworthiness becomes moot. Is there some "safe ads" codeless option for site operators who want to protect their users while still showing ads? Has Google made site operators aware they occasionally deliver malicious JS to users?

Re:An iframe from googlesyndication.com tries to access the ... by samhw on Monday December 20, 2021 @02:49PM (#29629288)
> To be safe online we go to sites we trust.

I'm fairly confident in saying that nobody, but nobody, only goes to sites they trust. Come on. You're on HN: do you mean to tell me that you never click to open a link from a post unless you've pre-vetted the website and know it to be trustworthy? That's simply not a practicable model.

And every site pulls in JavaScript which, to you, is arbitrary. You don't know that they won't add a new third-party script, and you don't know that any given third-party script won't change. You don't know that transitively for the scripts loaded by the scripts. Etc etc etc. Nobody can practise the approach you are setting out here, not both diligently and honestly.

Your complaint here is just about how the internet works. It's absurd to expect Google to vet the JavaScript that all of its users host, as much as it's absurd to expect Squarespace or Weebly or even AWS or Cloudflare to do the same. The model of the internet does not and cannot rely on any and all JavaScript being vetted for 'malice' by a trusted party before being loaded. It relies on the JavaScript runtime being a safely isolated sandbox where malice or the lack thereof doesn't matter either way.

Re:An iframe from googlesyndication.com tries to access the ... by smolder on Tuesday December 21, 2021 @07:20AM (#29636651)
I didn't say people always have a good reason for trusting the sites they go to. I trust that HN links are safe because I think that someone would make a stink, at least, if there were malware on a page linked here. It's not perfect but it is how things work. A nasty part of contemporary business and business in general is: as long as trust isn't visibly betrayed, people go on trusting. That doesn't excuse any of the actors who benefit from the ignorance.
Re:An iframe from googlesyndication.com tries to access the ... by jefftk on Sunday December 19, 2021 @11:55AM (#29615583)
Ads are allowed to run arbitrary JS, but that doesn't mean they are allowed to do arbitrary things by policy. That is, the technical restrictions are not able to be as strict as the policy.

A bunch of us were working on a project where ads would be fully declarative, and so no longer able to run arbitrary JavaScript, but this received very little interest outside of Google (advertisers didn't want to move to a new format, publishers didn't care) and we moved on.

(Still speaking only for myself)

Re:An iframe from googlesyndication.com tries to access the ... by barneygale on Sunday December 19, 2021 @12:22PM (#29615893)
I do wish google engineers would do something positive for society and switch to a career in subsistence farming. No one needs ads. Not arbitrary JS ads, not declarative ads, not personalised ads, not any ads.
Re:An iframe from googlesyndication.com tries to access the ... by jefftk on Sunday December 19, 2021 @12:35PM (#29616060)
But what do you see as the alternative for funding sites? The site we're on is funded by (declarative, non-personalized, non-obtrusive) ads. I would rather have ads than paywalls.
Re:An iframe from googlesyndication.com tries to access the ... by luckylion on Sunday December 19, 2021 @12:54PM (#29616307)
"Made for Adsense" sites have no value, if they get shut down, nothing is lost. Normal sites that switched to Adsense have become worse, because now they need clicks and engagement above all else, incentivizing click-bait and low-effort content. Nothing would be lost if they switched to subscription models and provided valuable content. There's little in between in my opinion, it's either "site doesn't use Adsense, it's a company site / personal blog / some institution", "site was made only to make money by adsense with the lowest price content possible, had a bunch of links bought and now provides a passive income to some SEO" and "site used to provide quality content, loses readership to spam-sites because Google has fucked up their sorting algos and now switches to low-value content as well, because anything else can't be financed".

Twitch shows that people are very willing to pay for content. I'd very much be happy to if that removed all of the spam.

Re:An iframe from googlesyndication.com tries to access the ... by Ansil849 on Sunday December 19, 2021 @12:55PM (#29616325)
If a website cannot survive without ads, maybe it doesn't need to actually exist in the first place. The world will go on.
Re:An iframe from googlesyndication.com tries to access the ... by shukantpal on Sunday December 19, 2021 @02:26PM (#29617369)
The world can move on without having the site shutdown, then. Don't visit those sites and pretend they don't exist.
Re:An iframe from googlesyndication.com tries to access the ... by jefftk on Sunday December 19, 2021 @01:22PM (#29616641)
I do think the world would go on, but it's a world I would like less. Some things would move behind paywalls, others would move to the boundary of whatever was considered advertising (sponsored content? Product placement?)
Re:An iframe from googlesyndication.com tries to access the ... by Ansil849 on Sunday December 19, 2021 @01:38PM (#29616838)
I think of it as a bit of social selection for websites. If a website has content people value, they find ways to support the website. If not, well, maybe the site not existing is not a terrible loss.
Re:An iframe from googlesyndication.com tries to access the ... by denton-scratch on Sunday December 19, 2021 @02:55PM (#29617667)
Once upon a time, children, people made websites with no ads, and no paywalls. Sure, there weren't as many websites; and sure, they didn't have as many sliding panels and other gimmicks.

And for sure, I appreciate being able to buy stuff online. But I seem to be able to do that without viewing ads! Amazing!

Re:An iframe from googlesyndication.com tries to access the ... by ineptech on Sunday December 19, 2021 @03:11PM (#29617845)
> I would rather have ads than paywalls.

No offense but I've heard people who work at ad companies repeat this like a mantra, and it's a false dichotomy, akin to a coal company who dumps slag in rivers saying, "Well we think it's better than letting everyone freeze to death." We're not asking Google to stop advertising altogether and close up shop, just to make the internet ad ecosystem a little less awful and Orwellian.

Re:An iframe from googlesyndication.com tries to access the ... by jefftk on Sunday December 19, 2021 @03:52PM (#29618272)
> We're not asking Google to stop advertising altogether

I think my parent was: "No one needs ads. Not arbitrary JS ads, not declarative ads, not personalised ads, not any ads."

Re:An iframe from googlesyndication.com tries to access the ... by ineptech on Sunday December 19, 2021 @05:06PM (#29618914)
Fair enough, though the suggestion that Google engineers take up farming was probably not very serious. However, the idea that we have a choice between no ads or the most pernicious ads imaginable is certainly a false one.
Re:An iframe from googlesyndication.com tries to access the ... by jefftk on Sunday December 19, 2021 @05:54PM (#29619383)
> the idea that we have a choice between no ads or the most pernicious ads imaginable is certainly a false one

I agree with you. I spent a large part of 2018-2019 trying to make ads declarative, and am now working on (among other things) increasing the isolation of conventional ads [1] and implementing cross-site advertising without cross-site identity leakage [2].

But it sounds like you and my parent have very different views: there's a lot of space between "ads should be a lot better" and "ads should not exist".

[1] https://github.com/WICG/webpackage/issues/624

[2] https://github.com/WICG/turtledove/blob/main/FLEDGE.md

Re:An iframe from googlesyndication.com tries to access the ... by _hyn3 on Sunday December 19, 2021 @12:00PM (#29615661)
Why is it up to the advertisers and publishers?
Re:An iframe from googlesyndication.com tries to access the ... by jsnell on Sunday December 19, 2021 @12:28PM (#29615980)
If they tried to unilaterally make such a change and ban the old formats, both the advertisers and publishers would complain to competition regulators around the world. And whether you think there would be any merit to those complaints or not, the outcome would still be another round of lawsuits with billions on the line.
Re:An iframe from googlesyndication.com tries to access the ... by denton-scratch on Sunday December 19, 2021 @02:58PM (#29617706)
> with billions on the line

Not my money. Why should I care about lawsuits between advertising networks and their advertisers, regulators and so on?

Re:An iframe from googlesyndication.com tries to access the ... by asdfasgasdgasdg on Sunday December 19, 2021 @09:53PM (#29621087)
> Why should I care

You don't need to. But the person is asking why Google is or is not doing a particular thing. So it is their interests that are relevant to the current discussion, not yours.

Re:An iframe from googlesyndication.com tries to access the ... by Tsiklon on Sunday December 19, 2021 @12:10PM (#29615763)
I suppose they're the paying customers.
Re:An iframe from googlesyndication.com tries to access the ... by fault1 on Sunday December 19, 2021 @12:21PM (#29615889)
how do you think google, an adtech company, makes money?
Re:An iframe from googlesyndication.com tries to access the ... by oauea on Sunday December 19, 2021 @11:49AM (#29615505)
> Since ads can run arbitrary JS

What a fantastic idea to create a platform where anyone can pay to have code ran on millions of end-user machines, embedded in random websites. What could possibly go wrong?

Re:An iframe from googlesyndication.com tries to access the ... by hetspookjee on Sunday December 19, 2021 @11:57AM (#29615609)
Haha, easy way to create plausible deniability if you just allow everything to run :D. Doesn't that also make it easy for anyone running an ad to run hivemind in the ad itself?

In addition, why is it hard to enforce a policy that disallows any ad to reach out to the camera and microphone? I don't understand why that is hard to enforce.

Re:An iframe from googlesyndication.com tries to access the ... by jefftk on Sunday December 19, 2021 @12:42PM (#29616157)
> Doesn't that also make it easy for anyone running an ad to run hivemind in the ad itself?

Are you talking about crypto mining? That's a good example of something which is against policy but difficult to fully prevent technically. The core problem from someone trying to exploit this, however, is that crypto mining in the browser is minimally profitable, so you need to do a huge amount before seeing noticeable returns. The more you try to do the more likely you are to get caught, so while it does take some scrutiny from publishers and ad networks, it doesn't take very much.

(still speaking only for myself; this isn't something I know very much about)

Re:An iframe from googlesyndication.com tries to access the ... by hetspookjee on Sunday December 19, 2021 @12:47PM (#29616214)
Yes, I am talking indeed about crypto mining. I am also talking mostly about the aspect of wasting compute cycles and thus harming the environment through Google's means. Yes, it is minimally profitable, but that it is possible is weird if you ask me.
Re:An iframe from googlesyndication.com tries to access the ... by jefftk on Sunday December 19, 2021 @12:56PM (#29616336)
Sorry, what I meant was that it is minimally profitable at the best of times. Which means it doesn't take very much enforcement to shift it over to being negatively profitable, because it costs you more in time, engineering, etc. than you would make. And once it is a money losing proposition, the people trying to exploit users are no longer interested.
Re:An iframe from googlesyndication.com tries to access the ... by mschuster91 on Sunday December 19, 2021 @12:15PM (#29615815)
Because ads can use Javascript which is notorious for how hard it is to vet code and how easy it is to hide functionality.
Re:An iframe from googlesyndication.com tries to access the ... by hetspookjee on Sunday December 19, 2021 @12:44PM (#29616177)
But why do they need that? What purpose does an ad with javascript serve?
Re:An iframe from googlesyndication.com tries to access the ... by mschuster91 on Sunday December 19, 2021 @01:29PM (#29616718)
Animations, tracking and fraud detection are the big areas. Ads were historically one of the strongest drivers of Flash, given how easy it made for creatives to implement animations without needing a frontend developer - ad buyers these days would instantly protest against any attempt to remove either of the three use cases.

And given that we are talking about sometimes eight figures worth of ad buying... no network will want to risk offending such clients.

Re:An iframe from googlesyndication.com tries to access the ... by hetspookjee on Sunday December 19, 2021 @04:12PM (#29618475)
I still don't understand it. I was under the impression that animations are also able to be served through HTML5? Both CSS and HTML should be sufficient. ~We're in the age where we're able to serve an entire sqlite database over a static website, yet an animation does require javascript?~

EDIT: I am wrong to think that serving and interacting with a sqlite database goes without javascript.

Re:An iframe from googlesyndication.com tries to access the ... by danachow on Sunday December 19, 2021 @05:23PM (#29619075)
> We're in the age where we're able to serve an entire sqlite database over a static website

Making use of the SQLite database is entirely client side and requires JavaScript or WASM (the distinction is unimportant) - it requires running code on the frontend. This is not a great way to state your case.

Re:An iframe from googlesyndication.com tries to access the ... by hetspookjee on Sunday December 19, 2021 @06:06PM (#29619492)
You're right and I misinterpreted the sqlite implementation. I will edit my comment to reflect my error.
Re:An iframe from googlesyndication.com tries to access the ... by jefftk on Sunday December 19, 2021 @05:59PM (#29619435)
Animations can be CSS, yes. That's what you do in https://amp.dev/documentation/guides-and-tutorials/learn/a4a... (declarative ad format, no advertiser-written JS)
Re:An iframe from googlesyndication.com tries to access the ... by hetspookjee on Sunday December 19, 2021 @06:09PM (#29619513)
Then I don't understand the necessity for javascript in ads?
Re:An iframe from googlesyndication.com tries to access the ... by jefftk on Sunday December 19, 2021 @06:25PM (#29619646)
In this particular case, advertisers were not interested in moving to a declarative format, and publishers were not interested in requiring declarative ads. So it didn't end up going anywhere as a general purpose ad format.
Re:An iframe from googlesyndication.com tries to access the ... by williamtwild on Sunday December 19, 2021 @11:49AM (#29615497)
How about the company you work for disallow arbitrary JS in the ads they serve? We already know the answer though. Bottom line over doing what is right.
Re:An iframe from googlesyndication.com tries to access the ... by jefftk on Sunday December 19, 2021 @12:30PM (#29616008)
As I wrote above, this was something we tried: https://news.ycombinator.com/item?id=29615583

This was the main thing I worked on in 2018-2019, along with many other engineers. I wrote about it some in https://www.jefftk.com/p/value-of-working-in-ads If this is something that users were demanding I could see picking it up again, but as far as we could tell us a time there was minimal interest externally.

Re:An iframe from googlesyndication.com tries to access the ... by denton-scratch on Sunday December 19, 2021 @02:48PM (#29617595)
> Since ads can run arbitrary JS it's hard to enforce policy programmatically.

It's not that hard, at least not at my end. I just don't run ads.

Why on earth does goo think that running arbitrary JS on their visitors' computers is OK? I mean, I know this is the policy, and I assume the policy of other ad networks is at least as "liberal". So I'm sorry, chaps, but no ads run on this screen.

I wonder if this is a race to the bottom? I've noticed that TV ads these days are all for animal charities, equity release schemes, and incontinence pads. I don't know what they're running in web ads, but I'm pretty sure that the TV ads are so dire because everyone but old fogeys and poor people skip the ads. I'd assume the same old/poor people are the ones that have to see web ads.

Advertising to poor people has traditionally been a pretty bad pitch. So why isn't the online/TV ad industry crumbling? And how do I bet against their shares?

Re:An iframe from googlesyndication.com tries to access the ... by javajosh on Sunday December 19, 2021 @05:40PM (#29619244)
>Advertising to poor people has traditionally been a pretty bad pitch

Is that true? It seems like poor people spend, in aggregate, more than rich people and they tend to buy the cheaper, more mass-produced stuff. The grocery business alone must be build on the commerce of poor people, right?

Re:An iframe from googlesyndication.com tries to access the ... by denton-scratch on Monday December 20, 2021 @10:49AM (#29626200)
> The grocery business alone must be build on the commerce of poor people, right?

How often do you see grocers advertising own-brand baked beans? If you see baked beans advertised at all, they're drawing attention to the fact that their Heinz beans are 1p cheaper than $COMPETITOR's Heinz beans.

I'm not convinced that advertisers spend much money on pitching to poor people. Most of the ad pitches that I see are for high-end products like cars, holidays, and household appliances. There's not much point in advertising to people whose weekly budget doesn't stretch to luxuries. They will buy only what they need; they don't have choices.

Re:An iframe from googlesyndication.com tries to access the ... by javajosh on Monday December 20, 2021 @05:06PM (#29630974)
If placement is considered a kind of advertising spend (and I think it is) then impulse buys are going to be an ad spend in general. Gambling, porn, junk food, that kind of thing.
Re:An iframe from googlesyndication.com tries to access the ... by tgsovlerkhgsel on Sunday December 19, 2021 @06:38PM (#29619792)
> Since ads can run arbitrary JS

That's the problem!