I have a shared hosting that I use to upload front end projects only. My file manager has only HTML, CSS & JS files. I don't have any forms or receive anything from the user. But every few months, I get code injected to my JS files and it causes the creation of random email accounts/subdomains/redirection to other websites.
The code I found in the files:
I have a SSL certificate, the permission of the affected files is 0644.
Judging by the code in the pic, what's the cause to this problem and what can I do to stop it?
Thanks.