Can I use a ServiceWorker to prevent an XSS attacker from gaining access to private user data?

I run a small blogging platform, and I want my users to be able to embed javascript that runs on their blogs (to manipulate the DOM, etc. as you might if you were hosting your own website). However, I do not want them to be able to:

acces… Continue reading Can I use a ServiceWorker to prevent an XSS attacker from gaining access to private user data?

Does enabling SharedArrayBuffers via service worker headers create Spectre vulnerability?

In browsers, use of SharedArrayBuffer is restricted to sites with the following HTTP headers because otherwise it exposes vulnerabilities to Spectre and Meltdown.
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Opener-Policy: same-… Continue reading Does enabling SharedArrayBuffers via service worker headers create Spectre vulnerability?

Does it matter that my browser shows an out-of-date certificate when a website uses service workers?

A website I frequent (a Discourse forum) uses Let’s Encrypt TLS certificates which are updated every two months with a valid period of three months. But the certificate information shown by Chrome says that the certificate is out-of-date a… Continue reading Does it matter that my browser shows an out-of-date certificate when a website uses service workers?

Is it possible to direclty read a variable from a service worker (ServiceWorkerGlobalScope)?

Is it possible to get the counter variable (ServiceWorkerGlobalScope) from the main thread without using the postMessage method?
service-worker.js:
let counter = 42;

self.addEventListener("message", function (event: any)… Continue reading Is it possible to direclty read a variable from a service worker (ServiceWorkerGlobalScope)?

Are web worker / service worker secure environments to store a password, credit card information, access tokens?

If there is a case where I wish to store sensitive data like a password, credit card information, or access tokens:
Are web workers / service workers a secure environment, where such data can not be compromised?
If so, what to do to really… Continue reading Are web worker / service worker secure environments to store a password, credit card information, access tokens?

What measures can be taken to make a site safe again after a hostile service worker is installed in users’ browsers?

So my understanding of Service Workers is that once installed they grant you full control over requests to a domain. If an attacker managed to include their service worker in your site, then for anyone who visited that site the service wor… Continue reading What measures can be taken to make a site safe again after a hostile service worker is installed in users’ browsers?