Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm using a shared hosting to host my website and have some problems with files from time to time. First, one of my file (php) was missing a part of code (nothing to do with hackers just a random piece of code was missing), then after some time a value inside a mysql table was also missing a part, then a whole table column disappeared, after that a whole file on my site disappeared and lastly again some code from a file disappeared, my hosting service says it has nothing to do with them, but this is stupid, how can this happen, no hacker attack could do such a thing, I believe it's some kind of a disk corruption or bad backup.

Anyone have any ideas?

share|improve this question

3 Answers 3

Actually what you are saying is possible. It could be security bug in your code. Do you sanitise user input. Are you aware of cross site scripting, sql injection attacks?

In case there are problem in your code then

Deleting files could be because of code injection. http://en.wikipedia.org/wiki/Code_injection

MySQL data deletion could be attributed to sql injection attacks.

To learn more about the attacks and how to prevent them visit http://www.owasp.org

share|improve this answer
    
All user input is inserted into database with added slashes, and also site is php and no eval or any other code is there that could allow a user to execute php code. –  dfilkovi Dec 18 '10 at 23:54

Depending on who your shared host is, they could have their servers setup in such a way that other users are permitted to edit your files. It's tough to prove this, but take a look at the owner/permissions of your files. If they are owned by you, you can try chmod 755 on them. This should prevent other users from being able to edit them.

If they aren't owned by you, I'd suggest asking your hosting provider about it, but you may have to find a new host if they aren't willing to secure the machine.

share|improve this answer

As a general rule of thumb (personally) I tend to stay away from shared hosting setups, they are prone to a number of issues first and formost being the "other site on the box" problem,

You could be sharing the server with 20 or so other clients, in this case if the server is not setup properly (and even in some cases where it is), no matter what you do to make your code secure, it is only as secure as everything else on there, I have seen a site compromised through no fault of it's own in this manner.

  1. Can you replicate this locally?

If not time to consider another host I'd recommend using a VPS provider such as linode, or if you want to go "cloud" there's EC2, cloudhosts, rackspace etc ...

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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