WEBVTT

00:00.000 --> 00:07.120
This talk is Escaping the Privacy Sandbox with Client-Side De-Anonymization Attacks.

00:07.120 --> 00:10.560
So if this is the wrong talk, this is your time to change.

00:10.560 --> 00:12.420
But otherwise, thank you for staying with me.

00:12.420 --> 00:14.800
And let's have a good 45 minutes.

00:15.980 --> 00:17.640
So a little bit about me.

00:18.000 --> 00:18.980
I'm Eugene Lim.

00:18.980 --> 00:21.880
I go by SpaceRaccoonOnline and I'm from Singapore.

00:22.040 --> 00:25.340
It took about 15-16 hours to get here.

00:25.340 --> 00:28.800
And it's currently, I think, 7.30am in Singapore.

00:28.800 --> 00:31.360
So let's see if I can make it.

00:31.500 --> 00:36.340
In my day job, I do application security for a small organization of about 200 people.

00:36.340 --> 00:39.340
So I focus on cybersecurity, application security.

00:39.420 --> 00:42.460
But outside of my day job, I love to do vulnerability research.

00:42.460 --> 00:46.520
I kind of touch everything from hardware to software to web technologies.

00:46.700 --> 00:51.840
One of my most recent pieces of research was smart weighing scales that connected to the Internet.

00:52.000 --> 00:58.220
And I think the question of why would you connect that to the Internet is a pretty common theme across a lot of the stuff that I've done.

00:58.220 --> 01:01.100
So that's really part of my interest.

01:02.260 --> 01:12.280
So before we begin, I thought I'd just give a bit of background on what this is all about and why the Privacy Sandbox, why the Google Privacy Sandbox exists.

01:12.360 --> 01:18.980
And you may be aware that third-party cookies are a piece of web technology that's on the way out.

01:19.040 --> 01:29.060
A lot of advertising platforms use third-party cookies in order to track users and analytics and perform all kinds of functions such as conversion tracking.

01:29.060 --> 01:35.720
For example, if you view an ad and you make a purchase because you saw the ad, third-party cookies kind of serve that function.

01:36.380 --> 01:45.900
But one of the big changes that's happened in recent years is that browsers are starting to phase out third-party cookies because, you know, it's not great for privacy.

01:46.080 --> 01:53.000
And you may have also noticed that there's a bunch of new legislation and regulations that are restricting the use of third-party cookies.

01:53.000 --> 01:58.360
So if you have ever seen a website and you had a pop-up that says, do you accept or allow cookies?

01:58.360 --> 02:01.840
That's all part of that going on behind the scenes.

02:02.020 --> 02:05.420
And obviously, I think consumers are getting a lot smarter as well.

02:05.420 --> 02:14.760
So you see now browser add-ons and extensions as well as network-level ad blocking that are blocking the use of these third-party cookies.

02:14.980 --> 02:28.360
So in recognition of that, Google came up with the Privacy Sandbox technologies which allow and replace these third-party cookies functions in advertising, but do it in a more privacy-preserving manner.

02:28.440 --> 02:31.480
And I think we're going to unpack that for the rest of this talk.

02:32.200 --> 02:34.660
Now, I want to address the elephant in the room.

02:34.660 --> 02:43.000
So for those of you who are kind of plugged into this, Google has been saying that they're going to phase out third-party cookies for about, I think, four years now, since 2022.

02:43.260 --> 02:46.440
And every year, they kind of say, OK, we'll do it next year.

02:46.440 --> 02:52.840
And what happened in April, very conveniently, right after I submitted my talk, they said, OK, we're giving up.

02:52.840 --> 02:56.900
So we're not going to use Privacy Sandbox to completely replace third-party cookies.

02:56.900 --> 02:58.720
We're going to keep third-party cookies.

02:59.160 --> 03:06.420
But I think all that being said, why do we still care about the Privacy Sandbox that Google has built?

03:06.980 --> 03:10.420
Well, number one, obviously, is that it's already live.

03:10.420 --> 03:15.360
It's still being served in Chrome and Chromium-based browsers, including Microsoft Edge, for example.

03:15.360 --> 03:18.500
And a lot of ad tech companies still use it.

03:18.540 --> 03:23.940
Google is one of the biggest advertising platforms out there, and they still rely heavily on Privacy Sandbox.

03:24.560 --> 03:27.760
And I think, most importantly, it's still interesting, right?

03:27.820 --> 03:36.080
Because one thing that stood out to me when I was doing this research is that ad tech companies really don't want you to know about ad tech.

03:36.080 --> 03:37.900
They don't have a lot of documentation.

03:37.900 --> 03:40.400
They don't really publish a lot.

03:40.400 --> 03:44.500
And part of the reason why is, obviously, they take a lot of information, right?

03:44.500 --> 03:47.320
And they don't really want you to know too much about that.

03:47.320 --> 03:53.180
But I think also because it is privacy, it may not often overlap with security in some senses.

03:53.180 --> 03:59.340
And not a lot of research has gone into this very interesting field of Internet technology.

03:59.440 --> 04:04.180
But the fact is that advertising takes up a large part of the Internet today.

04:04.180 --> 04:10.500
And if you actually uncover a little bit more about it, as I have, there's a lot to unpack.

04:10.500 --> 04:12.280
So we're going to dive right in.

04:14.500 --> 04:16.740
So what is the Privacy Sandbox?

04:17.020 --> 04:26.980
This is a piece of technology that Google has built up over the years that's meant to replace some of the features and functions of third-party cookies to perform stuff like tracking, conversions.

04:27.340 --> 04:29.140
And it consists of three parts.

04:29.200 --> 04:35.480
The first is a set of proprietary... well, I wouldn't say proprietary, but client-side browser and mobile APIs.

04:35.480 --> 04:40.280
These are JavaScript interfaces that allow you to then perform some of these functions.

04:40.280 --> 04:50.280
The second is a walled garden that Google operates that allows advertising platforms to register with Google and also call on these APIs.

04:50.780 --> 04:52.300
And the last is pretty interesting.

04:52.300 --> 05:02.700
It is an aggregation and decryption of some of these aggregated analytic data in trusted execution environments that Google allows you to deploy in your own cloud accounts.

05:02.700 --> 05:08.960
And this is pretty interesting because they use the term trusted execution environment, but you're really just executing it in your own cloud account.

05:08.960 --> 05:13.380
And so there's some question as to whether it is that trusted.

05:13.580 --> 05:25.040
But for today, I'm going to focus on client-side browsers and mobile APIs, the client side of this, and there's already a lot that you can do to subvert some of these protections that the Privacy Sandbox offers.

05:26.420 --> 05:33.360
So I'm going to go through, I think, three weaknesses that I've discovered as part of my deep dive into the Privacy Sandbox.

05:33.420 --> 05:41.740
The first is the Attribution Reporting API and how I was able to leak some information through what they call transitional debug reports.

05:41.820 --> 05:47.260
The second is browser history reconstruction or stealing via side channels.

05:47.260 --> 05:55.880
And the last is the Shared Storage API, where I was able to leak private data from the shared storage through insecure workload code.

05:56.640 --> 06:04.960
And if you have some time, I'm happy to just take questions from outside of this talk if you have any questions to have.

06:06.260 --> 06:08.260
So let's dive right in.

06:08.260 --> 06:11.060
What is the Attribution Reporting API?

06:11.060 --> 06:20.940
And what you see here is kind of a screenshot from the Chrome debug where you can see the source triggers and reports that make up the Attribution Reporting API.

06:21.620 --> 06:32.200
Essentially, I think the Privacy Sandbox provides the Attribution Report API to solve and address a very common advertiser's problem, which is, all right, I paid for someone to see an ad.

06:32.200 --> 06:34.420
Did that ad actually lead to a conversion?

06:34.420 --> 06:40.080
If someone viewed the ad on website A, did they click the ad and eventually make a purchase on website B?

06:40.240 --> 06:42.580
And this operates entirely on the client side.

06:42.580 --> 06:49.100
So I'm going to break it down into a few steps about how this Attribution Reporting API works.

06:50.520 --> 06:56.000
Well, step one is, obviously, you have to first view the ad, and that's registering a source.

06:56.160 --> 07:04.600
So, for example, you visit a website like the publisher's website, it may be a new site or some other site that's hosting the ad, and you interact with the ad in some way.

07:04.600 --> 07:16.380
You may click on it, you may view it, and this can be done and registered using the AttributionSource attribute or the JavaScript AttributionSource option to any kind of XML HTTP request.

07:17.300 --> 07:34.840
Once this is done, the browser automatically sends a request with the Attribution Reporting eligible header to your AdTags server, which will then respond with an AttributionReportingRegisterSource header, which includes a specific destination that that ad is linked to,

07:34.840 --> 07:35.880
so that source.

07:35.880 --> 07:40.280
So, for example, you viewed an ad to maybe buy tickets to Singapore, right?

07:40.280 --> 07:44.500
The destination might be SingaporeAirlines.com, and so on and so forth.

07:44.500 --> 07:52.480
And this is then stored by the browser on your client-side storage for future matching, which I'll go into in the next steps.

07:53.380 --> 08:00.060
So you've viewed the ad, and now your browser knows that you've viewed this ad and potentially may make a conversion.

08:00.240 --> 08:06.640
This is what the request looks like when you make a request to the Google Ads server.

08:06.900 --> 08:09.440
Again, you can see the headers that are being sent.

08:09.540 --> 08:12.740
What's interesting I want to draw your attention to is on the right side.

08:12.920 --> 08:28.780
In the response as well, you would see some information regarding your source, such as the aggregation keys, the destination, some debug information, and all of these metadata that's used to characterize the ad that you just viewed for future analytics.

08:31.060 --> 08:32.320
So what's step two?

08:32.320 --> 08:34.080
Step two is a trigger.

08:34.080 --> 08:46.820
So you may click on that ad, you may go back to the website that was advertised later and make a purchase, and regardless of that, this is counted as a conversion that they may want to register.

08:47.320 --> 08:57.160
In order to do so, it's going to send a request again by your browser with the attribution reporting eligible header, and the AdTag server is going to respond accordingly as well.

08:57.160 --> 09:00.700
And this will then trigger source trigger matching.

09:01.480 --> 09:04.020
So this is what the requests look like.

09:04.020 --> 09:14.560
On the left, you have some sort of trigger where you maybe bought a product, and the Google Ads server is going to respond with some of this header data.

09:14.560 --> 09:23.500
You may notice, for example, some filters that are used to, again, characterize what kind of purchase you made, that may then be used to calculate a conversion.

09:24.880 --> 09:26.680
And this is the last step.

09:26.820 --> 09:34.280
After you have registered the source and you perform a trigger, the browser is going to try to match that trigger with your source.

09:34.280 --> 09:38.780
So, for example, you made a purchase after viewing an ad for Apple products.

09:38.780 --> 09:51.120
It's going to confirm if that happened by comparing the stored source in your browser storage, and it's going to use several other filters to confirm this.

09:51.220 --> 09:58.240
And it will then send an event level or summary report to the AdTag server, telling them that, yes, a successful conversion had occurred.

09:59.160 --> 10:08.540
So that was a lot of talking to explain what seems like a pretty simple function, which is just to register a successful conversion.

10:08.540 --> 10:13.500
And you can probably imagine how this can be done already using third-party cookies.

10:15.000 --> 10:27.380
But I think one of the key things, if you look at the request that was sent, where it's an event report confirming a successful conversion, is that there's actually quite limited data that's being sent.

10:27.380 --> 10:36.760
It sends a destination where this attribution has occurred, it sends some metadata related to your conversion, but not a lot more than that, and that is by design.

10:38.540 --> 10:45.260
So there are some intended privacy protections for this very complex way of implementing a conversion.

10:45.660 --> 10:49.740
First is that Google Privacy Sandbox adds randomization.

10:49.740 --> 10:58.800
It randomizes the time when the report will be sent, so that you can't individually filter for a specific individual's behavior.

10:59.100 --> 11:03.260
It sends a limited set of data that is supported by the Privacy Sandbox API.

11:03.260 --> 11:20.740
And it's also pretty noisy, because it adds, I think, aggregate noise, so that while individual activity is somewhat obfuscated, you can't actually track a single person's browsing history because of this, on aggregate, you're still going to get fairly accurate data and analytics.

11:20.860 --> 11:25.060
So this seems like it solves all of the problems.

11:25.060 --> 11:28.360
You have privacy, but you also have analytics.

11:28.360 --> 11:29.640
So that sounds pretty good.

11:29.640 --> 11:31.920
So obviously we've got to break it.

11:33.140 --> 11:42.620
So one of the first things about the Privacy Sandbox API that you may notice is that it tries to solve many problems at once.

11:42.620 --> 11:49.360
It tries to make the marketers happy, it tries to make the advertising platforms happy, and it tries to satisfy privacy concerns.

11:49.460 --> 11:53.740
And one symptom of that is that you see a lot of escape hatches.

11:53.740 --> 11:56.940
And one of these escape hatches is debugging reports.

11:56.940 --> 12:04.540
So if you look at the documentation for the Privacy Sandbox API, it says that these are explicitly transitional debugging reports.

12:04.540 --> 12:06.420
They're not meant to last forever.

12:06.580 --> 12:10.780
They're only supposed to last up until third-party cookies are deprecated.

12:10.840 --> 12:12.800
Well, good luck with that, because they're not doing that anymore.

12:12.800 --> 12:15.000
So this is now a permanent feature.

12:15.400 --> 12:29.540
And what this is used for is essentially a way for advertising platforms to perform additional debugging requests with additional information about a particular conversion, or ad view, and so on.

12:30.760 --> 12:33.640
And ostensibly, this is a feature, not a bug.

12:35.380 --> 12:44.180
Now, if any of you have done source code review or static analysis, you'll know that one of the favorite things to look out for is to-dos, because it never gets done in the code.

12:44.180 --> 12:55.620
And this is one of the to-dos in the system design for Privacy Sandbox API, where they said, consider adding support for the top-level site to opt in to receiving debug reports without cross-site leak.

12:55.620 --> 13:02.620
And what this means is that it's supposed to prevent leaking of cross-site data.

13:02.940 --> 13:05.600
Let me illustrate this with a simple example.

13:06.020 --> 13:10.020
A website may be loading third-party resources from a different origin.

13:10.020 --> 13:17.560
And typically, browsers can send a referral header that tells the third-party origin where this resource was being loaded from.

13:17.560 --> 13:20.380
And in some cases, this might be sensitive information.

13:20.440 --> 13:31.180
For example, you may be loading a website or an ad that is owned by a third party, and you don't want to know where the ad was being viewed.

13:31.520 --> 13:37.720
In this case, you would send a referral policy header with the no-referral value.

13:38.420 --> 13:49.260
But if you had enabled the Attribution Reporting API on this page, it would actually send the referral site, despite the no-referral policy, via a debugging report.

13:49.260 --> 13:56.460
So this would actually subvert a mitigation that you would typically have to prevent leaking of the top-level site.

13:58.040 --> 14:09.200
So what this means is that previous mitigations or protections that were based on this assumption of using the referral header no longer work as intended.

14:09.220 --> 14:12.340
And one of these technologies is SafeFrame.

14:12.540 --> 14:24.380
So SafeFrame is a hardened iframe standard by the Interactive Advertising Bureau, which is a conglomeration of various advertising platforms, including Google, which uses them for double-click ads.

14:25.460 --> 14:31.140
What SafeFrame is supposed to do is because actually serving ads on your website can be pretty risky.

14:31.140 --> 14:42.940
What you're essentially doing is that you are running JavaScript or HTML that is created by the person purchasing the ad, and this may actually be a security risk for your website.

14:43.280 --> 14:56.640
So by putting all of these ads within a SafeFrame, what it's meant to do is that it's prevent and limit the amount of data that's leaked through the SafeFrame or the amount of control that's done through the SafeFrame to the publisher website.

14:58.120 --> 15:05.600
But what the Attribution Reporting API does is that it effectively subverts the protections of the SafeFrame.

15:05.620 --> 15:16.860
You can trigger header error debugging reports deliberately through malformed Attribution Reporting API response headers, and this would then leak the top-level site.

15:17.700 --> 15:20.400
So I'll just kind of walk through an example here.

15:20.400 --> 15:27.720
We start with visiting the website, for example, the publisher, or maybe diverge.com, which is a tech website.

15:27.740 --> 15:34.560
And you interact with an ad that is within a SafeFrame, and this is how some Google ads are sometimes served.

15:35.340 --> 15:43.780
And it would then trigger an Attribution Reporting-eligible header to your attacker-controlled attack server.

15:44.180 --> 15:56.280
And by sending a malformed response in your header, this would trigger a header error debugging report on the browser site, which includes the contact site, which is the top-level site.

15:56.740 --> 16:04.120
Essentially, this tells the person who bought the ad and served the ad which website your ad was viewed in.

16:04.480 --> 16:10.880
Now, this might not seem so serious, but this is actually information that is typically meant to be obscured.

16:10.880 --> 16:17.160
You're not supposed to know whether this individual IP address has visited X website or not.

16:17.160 --> 16:24.100
If you buy an ad on Google, this data is aggregated, but it's not broken down into specific IP addresses.

16:24.360 --> 16:39.120
So by purchasing an ad on Google Ads, for example, and if this weakness was available, you would then be able to kind of serve a Trojanized ad that would de-anonymize the browsing traffic of anyone who views your ads.

16:40.500 --> 16:50.860
So this effectively subverts some of the protections in older advertising technology that may not have accounted for this new API.

16:51.960 --> 16:56.700
So what was pretty interesting was seeing how various advertising platforms dealt with this.

16:56.700 --> 17:09.600
If you look at Facebook Ads, which doesn't use SafeFrame, but has its own sandbox domain, it essentially disabled the Attribution Reporting API completely using the permissions policy header.

17:09.780 --> 17:11.560
And I think that probably makes sense.

17:11.560 --> 17:27.520
It's kind of a cat-and-mouse game, but this kind of highlights how important it is that your iFrame or your SafeFrame, where you're serving an ad, needs to be kind of a hermetic environment because new technologies emerge all the time, such as Attribution Reporting API,

17:27.520 --> 17:30.940
and this may break certain assumptions that your protections have been built on.

17:32.220 --> 17:37.820
So this was kind of an interesting start to this research.

17:37.820 --> 17:43.060
But what was more interesting is the destination hijacking attack.

17:43.700 --> 17:53.240
Now, what Privacy Sandbox API allows through Attribution Reporting API is to register multiple destinations, up to three of them, per source registration.

17:53.240 --> 18:07.960
So say, for example, you saw an ad for buying tickets to Singapore, and you can register not just SingaporeAirlines.com, you can register several other destination websites where someone can perform the conversion of buying a ticket.

18:09.180 --> 18:24.340
But while I was checking the real-world implementations of this in various websites, in this case, I was on Diverge.com, I began to notice two strange domains that were appearing throughout all of the Google DoubleClick ads that were served.

18:24.760 --> 18:33.760
If you kind of look at it here, I was viewing an ad for Semrush.com, and so obviously one of the destinations linked to this ad was Semrush.com.

18:33.980 --> 18:36.550
But two other destinations were added to it.

18:36.820 --> 18:41.920
One was DebugConversionDomain1.com and DebugConversionDomain2.com.

18:42.360 --> 18:46.520
Do you kind of want to make a guess what's wrong with these domains?

18:48.300 --> 18:50.080
Yeah, you could buy them.

18:50.460 --> 19:03.140
So Google DoubleClick ads was basically injecting this into every single ad that they served across the Google ad network as one of the destinations, and they didn't buy it for some reason.

19:03.140 --> 19:04.820
So it was debugging, right?

19:04.820 --> 19:05.820
So I bought it for $10.

19:05.900 --> 19:08.200
Or $20, because I bought both of them.

19:09.060 --> 19:12.340
Now, the question is, what can you actually do with it, right?

19:12.800 --> 19:20.040
On the surface, if you understand and kind of look through the attribution reporting API, this isn't super serious.

19:20.040 --> 19:22.640
It seems like you can maybe perform ad click fraud.

19:23.400 --> 19:41.580
So if a user visits a website, and you interact with the ad, and we now know that Google DoubleClick ads injects these two additional destinations for every single ad out there, if they then visit my attacker-controlled site, which is now DebugConversionDomain1 or 2.com,

19:41.580 --> 19:46.560
I could then trigger an attribution, and this would be counted as a conversion.

19:47.320 --> 19:51.320
So, OK, cool, but not super crazy.

19:51.900 --> 19:55.960
What I wanted to do was really just figure out what you've done, right?

19:55.960 --> 19:59.280
What websites you've been visiting and where you've seen ads.

20:01.100 --> 20:08.520
So I began looking for ways to get around this, and one of the things I started looking into was rate limits.

20:09.680 --> 20:14.840
The attribution reporting API is really very intentionally designed to preserve privacy.

20:14.840 --> 20:16.880
I don't think that's really a question.

20:16.880 --> 20:27.840
And one of the ways they've done this is they have added rate limits for various actions, because, for example, they don't want an advertiser to track too much information about a particular individual.

20:28.200 --> 20:36.480
They also don't want to create resource exhaustion by triggering too many of these client-side storage.

20:36.860 --> 20:43.800
There is one undocumented storage limit for event-level reports per destination site to prevent excessive resource usage.

20:44.400 --> 20:49.200
And through testing, I found that this was actually a limit of 1,000, so not too much.

20:49.200 --> 20:56.660
And when this limit is hit, new conversion reports can no longer be sent, and it's going to send an error instead.

20:58.780 --> 21:05.380
So we can actually leverage this oracle to find out if a user had visited a particular website.

21:05.840 --> 21:16.580
So, for example, they visit a publisher website, and they viewed an ad, and now we know, again, DoubleClick injects these two additional domains on top of the intended destination domain.

21:16.580 --> 21:24.640
And if the user did visit that destination domain and perform a conversion event, then one event-level report would be sent.

21:25.180 --> 21:45.240
But later, if they were to visit the attacker-controlled website, because I control debugconversion1.com and 2.com, I'm able to then repeatedly trigger source and trigger registrations and perform that matching, and trigger the remaining 999 event-level reports.

21:47.610 --> 21:56.450
Conversely, if that user didn't actually visit the advertiser.com destination, I would be able to send 1,000 of these reports instead.

21:56.450 --> 22:04.960
So this effectively allows me to use a Boolean oracle to determine if that user had actually visited the advertised website or not.

22:07.310 --> 22:25.630
So this then allows me to achieve de-anonymization, because by understanding and leveraging the DoubleClick ad network, I can figure out exactly where the user has been through a combination of filters and also this rate-limit oracle.

22:26.630 --> 22:37.930
Now, again, this is pretty much the opposite of what the Privacy Sandbox is supposed to do, which is to not leak an individual's browsing history to anyone.

22:37.970 --> 22:44.610
More concerning is that this doesn't even require me to be serving a protogenized ad in any form.

22:44.610 --> 22:51.570
It just means that the user has to have visited a website that served a Google DoubleClick ad in the past.

22:52.370 --> 22:58.610
So this is all fairly interesting, but there's still more to find.

22:58.870 --> 23:15.410
As I began to look into the rest of the advertising platforms, I noticed, for example, sites like YouTube.com were serving Privacy Sandbox API, Attribution API registrations with interesting destinations.

23:15.410 --> 23:18.970
In this case, user 436576.site.

23:18.970 --> 23:34.550
And one of the conclusions I kind of draw from this is that advertising platforms are actually kind of piggybacking on this data field to inject user-identifying information or use it for other kind of debugging purposes.

23:34.670 --> 23:51.450
And this is actually a common pattern you see in schemas, in protocols, when people have to perform certain actions, but the schema doesn't support it, so they use the existing schema to kind of hijack and build their own features on top of that.

23:51.470 --> 23:57.410
So there's actually a lot more to find in this abuse of destination sites.

23:59.370 --> 24:03.590
So the next thing I want to talk about is the Shared Storage API.

24:03.870 --> 24:13.530
So what the Shared Storage API essentially is, is a privacy sandbox API for cross-site storage and access to data in a privacy -preserving way.

24:13.550 --> 24:27.970
This again serves an advertising outcome , which is to able to store a user's interest group or any other identifying information regarding that user and to use it to then customize the ads that the user views.

24:27.970 --> 24:37.150
So it may store items such as, this person's a cat lover, or a new home buyer , and then be able to use this to serve specific ads for that user.

24:39.050 --> 24:44.430
And how this works is, again, through a set of JavaScript APIs unique to the privacy sandbox.

24:44.810 --> 24:48.410
In this case, for example, it would first set this value.

24:48.630 --> 24:51.070
In this case, ABTestingGroup is zero.

24:51.830 --> 24:55.550
Once this is set, it essentially should never be accessed again.

24:55.550 --> 25:01.790
The privacy sandbox API for shared storage does not allow you to directly retrieve that value ever again.

25:01.790 --> 25:10.010
So no website should be able to understand which cohort you belong to, what your interests are, again, to preserve the privacy of the individual.

25:10.970 --> 25:17.750
Instead, what you have to do through the shared storage API is to use something called shared storage worklet modules.

25:18.770 --> 25:22.950
And what this module does is that it uses something called an output gate.

25:22.950 --> 25:38.690
So for those of you who are familiar with, I think, confidential compute or trusted execution environments, this pattern actually takes some inspiration from that, where there's some private data that you do not want to expose directly to the person using that data,

25:38.690 --> 25:42.090
but that person can call on that data through a function.

25:42.090 --> 25:46.350
In this case, select a URL for what app to serve to that user.

25:46.810 --> 25:51.390
And the output of that function is the only thing that comes out of it.

25:51.390 --> 25:53.550
You never really access that data directly.

25:54.150 --> 25:58.810
So this is called an output gate in privacy sandbox API terminology.

25:58.810 --> 26:15.310
And what this output gate is then fed to is another privacy sandbox API unique element, which is called fence frame, which is some variant of an iframe with even more opaqueness so that the top level site can't even query what content is being loaded in a fence frame.

26:16.190 --> 26:30.510
So again, all of this complexity, all of this design, the whole point of it is that it should be completely opaque to the publisher side or the advertiser what value is in the shared storage.

26:30.950 --> 26:39.690
And this also allows them to anonymize a certain user based on what ads they're seeing online.

26:40.930 --> 26:53.710
So as I mentioned when I first discussed debugging reports, one of the symptoms that you see with the privacy sandbox API is escape hatches.

26:53.710 --> 26:59.510
And these escape hatches then subvert some of the protections built into the privacy sandbox.

27:00.170 --> 27:11.950
And there are a number of discussions, and I was looking through the GitHub issues, the mailing lists, and the documentation where there was this discussion about allowing for cross-origin shared storage workloads.

27:11.950 --> 27:21.310
This means that the origin that set the shared storage and the module that is allowed to access it can be loaded by other origins.

27:21.370 --> 27:23.630
And it's an opt-in feature.

27:23.930 --> 27:28.530
And this means that you have to make sure that your script is secure.

27:29.830 --> 27:37.450
Unfortunately, as we know, this is a foot gun that means that there's a lot of insecure implementations out there.

27:38.590 --> 27:43.970
One example I have here is fledge.criteo.com workload code.

27:43.970 --> 27:46.410
Criteo is another big advertising platform.

27:46.970 --> 27:52.590
In this case, it seemed fairly experimental, so I wouldn't say that this is full production.

27:52.950 --> 28:02.670
But in this case, what they were using shared storage for, and this is simplified code, they were using to set the A-B testing population value of a user.

28:03.190 --> 28:05.670
And this would be put in shared storage.

28:06.610 --> 28:21.070
Later on, this would then be used to select a URL that would be the advertising URL that would be displayed to that user, simply by performing an ends-with string match with the list of URLs passed to this function.

28:21.590 --> 28:34.410
Now you can see why this is probably an issue, because you're not actually supposed to know, firstly, what population this person is supposed to do, but you can infer that based on the URL that was matched.

28:36.410 --> 29:06.110
So in this case, what we see here is a proof-of-concept way to exploit this implementation, where an attacker, because this is a cross-origin workload code, can load the workload code and pass to it a number of URLs, and essentially add a fragment at the end of these URLs for the entire range of possible values that Chrome A-B-T population could be in a shared storage.

29:06.910 --> 29:16.530
And by loading the selected URL, you would now then be able to infer and retrieve the value of this shared storage.

29:19.180 --> 29:33.160
So in this case, we see here that shared storage value for Chrome A-B-T population is 2, and simply by visiting this proof-of-concept website, you're now able to fetch this value and kind of infer that and leak this value.

29:33.820 --> 29:38.740
I emphasize again that this is something that you're not supposed to do with the shared storage API.

29:38.740 --> 29:51.860
You're not supposed to leak cohort data about a particular individual, but because of the way that this worklet has been designed, and the way that cross-origin worklets have been enabled, this is now possible.

29:54.340 --> 29:58.420
So just a brief summary of some of these attacks that I've gone through.

29:58.440 --> 30:13.700
There are still more I think that you can probably find, but the first is the ability to leak the top-level site of someone who has viewed an ad to bypass certain legacy implementations such as SafeFrame.

30:13.700 --> 30:23.360
The second is de-anonymization with destination hijacking, to understand whether someone has visited a particular website in the past as a complete third party.

30:23.720 --> 30:31.900
And the last is to leak shared storage value that is meant to be completely private, but is now available to insecure worklet code.

30:34.100 --> 30:41.740
So I think I kind of talked a lot about all of these attacks, and I want to step back and look at the bigger picture here.

30:42.020 --> 30:46.360
The first is that privacy-preserving ad tech is hard.

30:46.360 --> 30:47.640
It's really difficult.

30:47.640 --> 30:58.060
I've gone through all the documentations and discussions, and the Privacy Sandbox API team has really put in a lot of effort to design it in a way that is privacy-preserving.

30:58.120 --> 31:03.820
But I will put it to you that privacy-preserving ad tech is an oxymoron.

31:03.820 --> 31:05.360
It's kind of impossible.

31:05.440 --> 31:13.740
And in order to satisfy the needs of both advertising platforms and marketers and obviously ad buyers, something's got to give.

31:13.740 --> 31:26.240
And this emerges in the form of all the escape hatches that are built inside the Privacy Sandbox API, which then allow you to exploit it and subvert the protections of the Privacy Sandbox API.

31:26.640 --> 31:32.300
The second point I want to make is that this attack surface is still large and unexplored.

31:32.400 --> 31:37.680
I think the web has a long history of hardening new features over time and continuously iterating them.

31:37.680 --> 31:44.440
As new standards are put out, bypasses are discovered, and then the standard is then further hardened.

31:44.440 --> 32:03.220
In the case of the Privacy Sandbox API, I think I get the sense that not enough research interest has been put into the Privacy Sandbox API, and a lot of it has now kind of subverted the assumptions of existing protections and mitigations in advertising technology.

32:03.220 --> 32:08.160
So, my encouragement to everyone is look into advertising technology.

32:08.160 --> 32:18.300
It's a large field that I think takes up a large percentage of the internet today, but I think it's going to be a lot more interesting than you think.

32:21.040 --> 32:25.280
So, there's still a lot more to do with regards to the Privacy Sandbox.

32:25.360 --> 32:31.620
For example, the client-side APIs, what I presented today is only a small portion of all the browser-side APIs.

32:31.700 --> 32:45.920
There's a Topics API, a Protected Audience API, Private Aggregation API, and I haven't even kind of dealt with fuzzing any of these APIs, so you may want to look into the actual code that implemented this in the Chrome and Chromium-based projects.

32:46.240 --> 32:48.760
The second is the aggregation service.

32:48.860 --> 33:07.300
There's a whole additional set of infrastructure that the Privacy Sandbox offers that advertising platforms can run in their own environments that is ostensibly meant to be a trusted execution environment that fetches and decrypts information about aggregate analytics data,

33:07.300 --> 33:11.520
but not actually leak that data directly to the advertising platform.

33:11.520 --> 33:13.180
This is a big question mark.

33:13.180 --> 33:19.640
As I've seen with the client-side APIs, there may be escape hatches, there may be issues, so there's a lot to do here.

33:20.040 --> 33:21.680
And the last is enrollment.

33:21.700 --> 33:26.900
So, the Privacy Sandbox API and the Privacy Sandbox is a walled garden.

33:26.900 --> 33:38.040
You have to register as a company or an advertising platform in order to use the attribution API, and this is done through a set of attestations that rely on public keys, for example.

33:38.540 --> 33:49.980
And the question is, if this can be subverted, and you can bypass this enrollment to then manipulate and abuse the Privacy Sandbox APIs.

33:50.540 --> 33:56.580
So, there's a lot more to do and a lot more research to do, so I hope this kind of sparks your interest as well.

33:58.020 --> 34:01.640
So, with that, I think I bring the presentation to an end.

34:01.640 --> 34:18.920
I hope this has given you a kind of brief background on the Privacy Sandbox, given you a bit more interest in advertising technology that tends to be ignored by researchers, and hopefully gives you some ideas of creative ways that you can use to attack and bypass privacy-preserving technology.

34:18.980 --> 34:21.740
If you have more questions, I have a website.

34:21.860 --> 34:24.280
I'm going to post the white paper there.

34:24.280 --> 34:31.320
I also do have a Twitter account, and I also have a book signing tomorrow with Nostalgia Press at 1pm.

34:31.320 --> 34:32.680
So, I hope to see you there.

34:32.680 --> 34:33.480
Thank you.

