Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaks proxy caching, with privacy consequences #80

Closed
Rudd-O opened this issue Sep 30, 2016 · 9 comments
Closed

Breaks proxy caching, with privacy consequences #80

Rudd-O opened this issue Sep 30, 2016 · 9 comments
Labels

Comments

@Rudd-O
Copy link
Contributor

Rudd-O commented Sep 30, 2016

User 1: visit Plone with this addon using a browser(DNT=1). fronted by e.g. a Varnish server. Plugin generates viewlet with content that tracks the browser. Varnish caches page.
User 2: visit same Plone with this addon using a browser(DNT=1). Varnish serves cached page with content that tracks the browser.

In other words: caching defeats the privacy feature.

Fix: upon install, update plone.app.caching configuration to add Vary: DNT header. Alternatively, add Vary: DNT header when viewlet render is invoked (not recommended, as this would conflict with plone.app.caching).

None of these fixes are very reliable since plone.app.caching is not necessarily installed at the time of this plugin's installation, so then we have an install ordering problem.

@Rudd-O
Copy link
Contributor Author

Rudd-O commented Sep 30, 2016

Aha! I found that exact problem in this site:

http://www.brasil2016.gov.br/en/news/rio-2016-raises-the-bar-for-olympic-and-paralympic-sports

Try it yourself:

curl -H "DNT: 1" -H "Cache-Control: no-cache" -H "Pragma: no-cache" http://www.brasil2016.gov.br/en/news/rio-2016-raises-the-bar-for-olympic-and-paralympic-sports > 1
curl -H "Cache-Control: no-cache" -H "Pragma: no-cache" http://www.brasil2016.gov.br/en/news/rio-2016-raises-the-bar-for-olympic-and-paralympic-sports > 2
curl -H "DNT: 1" http://www.brasil2016.gov.br/en/news/rio-2016-raises-the-bar-for-olympic-and-paralympic-sports > 3
  • 1 should not contain the buttons, and it does not.
  • 2 should contain the buttons, and it does.
  • 3 should NOT contain the buttons, but the cache serves the page served to 2.

@Rudd-O
Copy link
Contributor Author

Rudd-O commented Sep 30, 2016

See #81 for another way in which privacy is broken.

@hvelarde
Copy link
Member

nice catch, thanks!

CC @keul

@keul
Copy link
Member

keul commented Oct 1, 2016

Yes, in my usecase DNT header and privacy cookie were added to Varnish cache configuration.
My fault. I didn't documented this when I added the feature.

@hvelarde
Copy link
Member

hvelarde commented Oct 3, 2016

I think we must load this client side the same way we did with the WhatsApp and Telegram plugins; having to maintain this in Varnish means we'll have entries duplicated for each page displaying the widgets.

@keul
Copy link
Member

keul commented Oct 3, 2016

@hvelarde totally agree. Client side is the way to go

@Rudd-O
Copy link
Contributor Author

Rudd-O commented Oct 3, 2016

Seems that implementing the two-click-to-like feature I requested the other day, is about to get much more straightforward.

Back to the topic: how does the page query the value of the DNT setting, in order to avoid third-party-loading the HEAD javascripts and images?

@keul
Copy link
Member

keul commented Oct 3, 2016

@Rudd-O seems is possible (that's totally new for me): https://davidwalsh.name/detect-track-javascript

Not sure how well supported this is.

@hvelarde
Copy link
Member

hvelarde commented Sep 5, 2017

mostly fixed in #133.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants