views:

31

answers:

2

Looking at analytics for a site I maintain that is powered by Magento I am seeing that every week there are lots of visitors reaching a 404 page and it is because there is null being appended to the url. I am always on the site and have never had this happen and have no idea where these are coming from. Has anyone else encountered this or have any ideas on how I can diagnose how these are being generated?

+2  A: 

Sometimes, especially on a commerce website, people change URL's manually in the address window to see if they can get into parts of the site they shouldn't, or to see if they can change prices somehow.

I'm not sure what you mean by "null appended to the URL". Try typing the malformed URL's into your own web browser, and see what happens.

Edited to add this thought:

If your site is being attacked with automated scripts, you might want to modify your 404 processing to capture the referrer. With referrer information it would be easier to sort out honest mistypings from an automated attack.

Gilbert Le Blanc
thanks for the response.. it is happening a LOT so I dont think it is a manual entry.. the entry paths look like they are coming from all over the place but IMO that part of analytics is lacking so not that much help in helping me figure out what is happening. What I mean that is instead of http://www.mysite.com it will be http://www.mysite.com/null which if I type it in takes me to the 404 page
zac
Gilbert's answer still seems likely. An automated attack against your site might do something like that. Either way, make sure that Google hasn't indexed any link like that (ban it in robots.txt).
Joseph Mastey
I'm thinking there's a problem in the automated attack script. In Java, if a field is null, it prints "null".
Gilbert Le Blanc
A: 

I'd look in my apache logs for the URL with the null characters as see what IP addresses they're coming from, and what the referrer is for each page. If I didn't have access to my apache logs I'd

  1. Create a Magento Module with an event handler that fires on every page requests (one of the controller page requests)

  2. In this even handler check to see if the URL has a null character on the end

  3. If it does, log the contents of $_SERVER somewhere

This should give you enough information to diagnose the problem.

Alan Storm