by jefftk · 6y ago · 0 comments
<html>
...
<script src=/fingerprint2.js>
...
The blocker sees ".*/fingerprint2.js" and excludes it. So far so good.But your site could, with minimal effort, do:
<script src=/asdf23f23g.js>
randomizing the URL on every deploy. This would circumvent url-based blocking today, with the downside of preventing the JS library from being cached between deploys.Web bundles change none of this. Just as you can generate an HTML file that references either /fingerprint2.js or /asdf23f23g.js, so can you generate a bundle. Unlike your claim in the article, this does not turn "circumvention techniques that are expensive, fragile and difficult" into ones that are "cheap or even free".
(Disclosure: I work for Google)
At root is private name resolution. What one bundle sees as asdf23f23g.js is different from what another bundle sees as asdf23f23g.js is different from what the web sees as asdf23f23g.js.
A site changing URLs often is a pain filter list authors deal with (automation, etc). Private namespaces for URLs is the real problem here that makes the proposal dangerous (and using it to randomize URLs is just a demonstration of how the dangerous capability can be used)
1. First HTML request: Generate a random string, put it in a server-side cookie, use it to name the fingerprinting script.
2. Later HTML requests: Pull the random string out of the cookie, use it to name the fingerprinting script.
3. Requests for the fingerprinting script: see that the cookie is present on the request, return the script.
This is some work, but not that much. And unlike a WebBundle version, it is cacheable.
Your cookie-based solution still requires the cookie as a sort of state tracker to memorize the URL in question. This requires some server-side logic to coordinate different requests and deal with cases where the cookie gets lost.
In contrast, implementing the same with web-bundles is as easy as generating a single HTML page: There is only a single script needed that generates the whole bundle in gone go and therefore can also ensure the randomized URL is used correctly without any kind of state.
If you're ok with giving up on this caching then you don't need cookies, you can have the server generate random-looking urls that it can later recognize are requests for the fingerprinting library.
You might lose some granularity in the filtering but most blocking is already done per-domain rather than specific assets.