POST-HOC EDIT
I was writing this post while checking on a some sites I've used.
After I posted I saw the reply from
bodyxs
I would definitely try their approach first.
My advice was based on coming to understand malware on a Mac - but I was clean.
And I am going to follow the links bodyxs listed.
We can all learn more.
Have you checked for suspicious extensions in Safari under Safari Preferences? Or just remove them all.
If that doesn't help have a look at https://sensorstechforum.com/wants-access-to-control-safari-virus-removal/
Now of course they want to sell you SpyHunter for Mac.
This App isn't available on the Mac App Store and I am not very good about web security and downloading Apps from external sites. The websites I trust direct you to the App store. I am still getting my head around what is and isn't correct about viruses, malware, worms, trojans, rootkits, spyware, bots, or whatever.
I did download Intego VirusBarrier Scanner which claims to detect malware.
It is a free download from the App Store. When I first ran VirusBarrier it pickup some very old Word docs from when I was using a PC, over 15 years ago. And it does not send me messages about upgrading to Intego Mac Premium Bundle X9 - or if it did I turned it off. Mac Premium Bundle X9 is a collection of security-focused programs, including VirusBarrier - which may be the same one as the free download.
I guess from easy to hard:
- Remove all Extensors from Safari - But I'd try doing it from starting my Mac in Safe Mode - that stops all software from launching during the boot process. It then runs a First Aid check of your Mac's startup disk and deletes some system caches that can be created again. I will admit that might be overkill.
- Try VirusBarrier Scanner from the macOS App store.
- Have a look at the article linked above. As far as the comment: "Manual threat removal might be a lengthy and complicated process that requires advanced computer skills". Remember they want to sell your their App: SpyHunter for Mac, which is not available on the App store.
If I wasn't sure about removing a file from a library I'd ask someone to check if they have that file as well - why not ask here.
Good luck.