I've recently become aware of a vulnerability on my blog script where someone can send a get request and supposedly break into the admin section. The thing uses cookie based authentication. Apparently I'm "not filtering user supplied data" properly. How do I do that? How do I block the malicious requests without blocking the legitimage ones?
Sounds like some form of data injection.If your script uses variables passed in the URL string (or POSTed form variables for that matter), then you should take steps to ensure the data you receive is valid. If you are simply working directly on the variables as they are passed, this means anything could be entered into your script as it executes. Look into some of the functions that escape special characters at php.net
Data is validated when it is recieved. The problem seems to be the manner in which I'm doing it. I get the data, username and password, then validate it against the database. The password is encrypted using a sha1 hash. Once validated a cookie is set to indicate that the user is properly logged in. Apparently someone could spoof the cookie and gain access. I'm not sure how to counter that.
Your website is down for me for some reason? If you can pm me a working live version of your script, I'll give you a quick free audit and a list of vulnerabilities in the script.
Take a look at Create a Persistent Login Cookie and Check a Persistent Login Cookie. Chris Shiflett's Essential PHP Security book is pretty good.
Thanks, but there doesn't seem to be a way to make attachements to a PM. Here's a link right to the thing, hope it works for you: http://www.archangelmgt.com/Archangel_Weblog_v090_02.zip By the way, there's a working demo of the thing online here: http://www.archangelmgt.com/weblog/. It's a raw install just as it comes out of the "box" so you can take a look at it that way if you want. Thanks again, Nick
Sorry, too busy to check php code, but let me guess is register_globals on ? That's the main source of problems. You can allow only sertain ip-s access for admin scripts Also check Apache's mod_security, can be useful