I have a bunch of JQuery plugins (eg: masonry, isotope, carousel, etc) within a JavaScript folder in my root. These have been repeatedly infected with viruses making Google put alerts on my site.

The permissions for the folders are 755 but they are still getting infected.

I am using the ModX Revo (latest) CMS.

Is there anything I can do?

1 Answer 1


Identify How The File Got Changed

First off you want to address the problem of how they are getting into your system since a chmod 755 means only the owner (The web server, ie Apache/iis) has access to write to the files therefor something else is doing the written to these files via your CMS/SQL/PHP.

  1. Identify how they got in... (Check access.logs, server.logs).
  2. Patch the vulnerability.

Shared Hosting

If you are on shared hosting then it could be that your web host has weak server side settings and generally others are being infected, I had a similar problem on GoDaddy once even though they denied it. Always make a ticket and have them run their own investigation after all its what your paying for besides hosting... i.e customer support.

Time To Cleanup and Toughen Up

Once you've identified and fixed the problem its time to harden up your ModX Revo site, it's also important to point out that often yes updating to the latest version is a good thing but most often hackers get in by other means (old of date plugins, or just plugins that are poorly designed.. Check these when identifying.

JavaScript Libraries Often Don't Need more than CHMOD 455

Additionally and finally you want to learn a little more about chmod, while there's nothing wrong with using 755 on your files you could prevent them being written to period by using a 455, Since how often do you edit JS library? You don't so make the owner of these files outside the scope of the web server process and make it 455 meaning that it can't change the file permissions or can the files being written too.. Again chmod should be seen as a last defense once there in, since 755 will only protect you so far.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.