4 ms·
I think that the extension architecture should make it easy to declaratively state which URLs an extension will call back to, and then make it up to the browser
by hn_throwaway_99 5y ago
I think that the extension architecture should make it easy to declaratively state which URLs an extension will call back to, and then make it up to the browser to transparently update CSP headers to allow those calls.
As someone who runs a website with a strict CSP, when I first went live I was panicked by the fact that we got TONS of reports about CSP violations to our report URL. It was only then when I realized that our CSP was blocking a ton of extensions that people had installed. Honestly, I think at that point I would have preferred that the extension update our CSP, it's not like the extension couldn't already see everything on our pages.
- kid-icarus 5y agoI have that same issue, but I would much rather filter out extraneous CSP violations than have some exploited extension exfiltrate sensitive data. Edit: typo
- hn_throwaway_99 5y ago> I would much rather filter out extraneous CSP violations than have some exploited extension exfiltrate sensitive data I am not familiar with the architectural framework of browser extensions, but would this already be possible, that is for an extension to read the contents of the page (which it obviously already has access to) but then send that information using a connection that doesn't operate in the same security context as the page that was read? I mean, browser extension CSP violations are triggered because the extension just basically injects a script into the page. Is it possible for the extension to just filter the page context and make a remote request by some other means?
- k1m 5y ago> Is it possible for the extension to just filter the page context and make a remote request by some other means? Yes it is. I think what you describe is in fact the preferred way for extensions that need to communicate with a remote service are expected to work, and when implemented that way, the CSP rules (rightly) don't apply. From what I understood of the article, this alternative way of sending data isn't what they mean by extensions tampering with security headers. The article doesn't go into detail but it would be interesting to see if the header tampering is necessary in all these cases, or if a different approach could work without triggering CSP.
- mschuster91 5y ago> I think that the extension architecture should make it easy to declaratively state which URLs an extension will call back to, and then make it up to the browser to transparently update CSP headers to allow those calls. Adblockers need to play whack-a-mole with this URL list to provide mocks that pretend to be ads to anti-adblock mechanisms, updating that declaration with extension updates every few hours will only lead to frustration.
- MomoXenosaga 5y agoYeah extensions need to deal with ads and tracking and the only way to do it is to nuke the site from orbit.