I had a rather interesting case of hacking on my ASP.Net MVC website. For this website I had implemented a rather uncomplicated authentication system for my admin area -- an encrypted cookie which had an identifying signature for the member. Whenever the admin visits the website the cookie would be decrypted and signature verified. If matching he wouldn't have to sign in.
Couple of days ago a visitor on my site told me that he was able to sign into my website simply by clicking no a referral link on his Statcounter console which pointed to my admin area (I had visited his site from a link inside my admin view).
He just clicked on a link in statcounter and he was signed in as the admin!
The only way this could have happened was if statcounter somehow recorded my cookies and used those when he clicked on the link pointing to my admin!
Is that logical or fathomable?
I don't understand what's going on. Do you have any suggestions as to how I can protect my website against things like this?
Update : I created an IP address whitelisting system to protect my admin from unauthorised access. Basically the server will now compare the IP address of the visitor against a whitelist and only allow access if the ip address is in that list. It also supports wildcards so it will be okay even for dynamic ip addresses.
Although it is not foolproof, but it takes up the security many notches.