Comment Spam, Punishing Users and Bugs – Oh My!

2. August 2010 20:28 by gogman in BlogEngine.NET Extensions, Development, Open Source  //  Tags: ,   //   Comments (13)

spam It seems that there has been an issue with posting comments on my blog. When posting a comment people would be greeted with the message "Sorry, the following error occurred while processing your comment: There was an error in the callback."

I had received a couple of reports regarding this but could never seem to replicate it. Well, it turns out the bug only happened to users who are not signed into my blog – which would be everyone but myself. I discovered this by accident after forgetting to sign into my blog and posting a test comment after getting a message regarding the error (thanks Aunt Pat!). All I could mange to to say to myself was: Duh….

After a couple of other tests verifying the bug existed, I set about trying to resolve the cause. The first place I started was in the extensions I use in the commenting system to help prevent spammers from littering the comments with useless comments and links. I disabled the Askimet and reCaptcha extensions and lo and behold, the bug went away! My gut instinct seemed to have paid off – for the moment.

At this point I decided to leave the extensions disabled, enable comment moderation, and not pursue the issue any further. I really hate forcing users to enter a CAPTCHA to post a comment. Entering a CAPTCHA is, at least in my mind, a form of punishment inflicted on the user by spammers and overly uptight sysadmins and being it was the wee hours of the morning, I decided to grab a quick round of TF2 and then go hit the sack. All was well in Well Rounded Geek land.

Upon waking the next morning, I engaged in my usual ritual of checking my email while slurping on a Red Bull and rubbing the sleep out of my eyes. My eyes rapidly opened as I was stunned to find 33 notification emails from my blog letting me know a comment had been posted. 33 comments all while I was lost in slumber! WOOHOO! People love me! Now wide awake, I logged into my blog to find that every single comment was spam.

Bloody hell! Mo&%er fu^@*!ng spammers!

After spending 20 minutes updating the filters on my blog and deciding that enough was enough, I hit Google. I had to find out what was causing the callback errors and doing a Google search first is a lot faster than firing up a full debugging session.

Luckily for me I almost immediately came across a forum posting describing the same issue I was having. Continuing to read down the thread, lo and behold I came across the exact problem I was having. And the best part: there was a fix posted by Andrea Dottor.

I immediately backed up copies of the offending files and implemented the fix. BAM! No more callback errors with all spam filters and services enabled. VICTORY! SUCK IT SPAMMERS!

There bug? It turned out to be a rather pedestrian mistake: trying to return the wrong type of object when calling the BlogService.LoadFromDataStore function inside the ReCaptcha component. I have posted the changed source code here:

All credit goes to Andrea Dottor for finding the bug and posting the solution.

So, dear readers and commenters, I apologize for the fact that you have to input the CAPTCHAs and jump through the hoop to post here. I don’t want you to have to do it, but the bloody spammers leave me no choice…

Comments (13) -

Dave
Dave
8/31/2010 10:52:58 AM #

Thanks so much for posting this!  I have been pulling my hair out trying to resolve the issue... even rolling back to BE 1.6 which stopped the error but lost ability to use Recaptcha.  

Alex @ Jacksonville Roofing
Alex @ Jacksonville Roofing
9/16/2010 12:32:23 AM #

Hey gogman, I am being frank here... I comment because I want a link. At least I am honest. Smile

But I am not a bot. There are just too many comment spammers using scripts and posting non-value sentence such as: "great post". I try to give genuine comments whenever I can. I hope you won't delete this comment! lol.

Christoph
Christoph
10/22/2010 10:25:05 PM #

I have to wonder if anyone bothered testing 1.6.1 before releasing it.  Thanks for posting this fix!  

gogman
gogman
10/23/2010 6:36:55 AM #

@Christoph

I think they tested it, but sometimes things slip through. At least it's open source and it can be fixed anyone and shared. All in all I have to say I really like BlogEngine.Net - so much so I have abandoned my own CMS I wrote and have used for years. I look forward to the next version with baited breath.

Reg
Reg
11/19/2010 5:44:12 PM #

Surely it is only a matter of time before someone comes up with an automated captcha reader? I have been really impressed with Askimet. It means I feel less popular as I don't receive nearly as many emails every day, but it keeps my blog nice and clean.

gogman
gogman
11/19/2010 5:53:48 PM #

@Reg

It seems that CAPTCHAs have been broken. www.guardian.co.uk/.../internet.captcha

Regardless, they seem to work fairly well with Askimet here in keeping spam out. However, like you, I do miss all the email even it was all about shoe sales (WTH is up with that?)

Dan
Dan
12/14/2010 11:11:29 PM #

I don't get it though. I made the change in the code but there's no difference. I also looked for a new dll but there was none there, even after re-compiling. What am I supposed to do after I make the changes in the code?

gogman
gogman
12/15/2010 3:14:54 AM #

Howdy Dan,

Can you be a bit more specific as to what issue you are having? I may be able to help you eh (sorry couldn't help myself eh) ;)

Dan
Dan
12/15/2010 8:21:32 AM #

gogman,

I made the change in the code but it's still doing exactly the same thing. I don't have much experience in ASP.Net so maybe I'm missing something. After you change the code is it supposed to take effect immediately or do you have to recompile it or something?

gogman
gogman
12/15/2010 12:50:53 PM #

Dan, what version of BlogEngine.net are you running?

Dan
Dan
12/16/2010 6:05:07 PM #

1.6.1, hosted on GoDaddy.

gogman
gogman
1/1/2011 8:35:36 AM #

Heya Dan, sorry for the delay in replying, been traveling over the holidays and missed your comment.

If you are running 1.6.1 then all you should have to do is extract the folders in the Zip file into the root directory of your blog. The existing files will be overwritten and the changes should work instantly.



Magento
Magento
3/17/2011 9:38:21 AM #

Yes Captha is broken...they can place all fake comment with special programs if they like..a shame!

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

About the Blogger

aBorn naked, unable to communicate, walk, or feed himself, Gogman overcame these handicaps to become a technologist, decent open water sailor, pretty darn good cook, husband, cat lover, and mediocre blogger.

Gogman works as the CTO at Atomic Goat Studios, an independent game studio start-up located in Southern California developing games for the PC, XBox 360, and Windows Phone 7.

Recent Comments

Comment RSS