I get a lot of user registration spam on my ubercart site, and it's turning into a cat and mouse game of IP-blocking using the Access Rules feature of D7.

So I thought it was time to use Mollom to protect the User Registration Form. But when I go to add that form at .../admin/settings/mollom/add, the only option is CAPTCHA. There isn't the option of text analysis. Yet a guick glance at the e-mail address or username they pick can tell me it's a spam account, and only once have I found a real user who's username looked like that a spammer would use.

I don't want to enable CAPTCHA - a lot of users of my store are not very confident with computers, and I don't want the intimidation barrier of filling out a CAPTCHA. Is there any way that Mollom could either:

  1. Use text analysis and only present the CAPTCHA if it's unsure - much as Mollom works for comment spam. The text analysis would analyse the username, the e-mail address, or both.
  2. Use a beacon image file in the page, and detect if that image is loaded. All the spam registrations I get are from bots who don't even bother to load the whole page. I don't even need the user to enter the CAPTCHA correctly; if the CAPTCHA question displays on screen it's a real user. So a carefully crafted blank.gif type of file could detect a spam registration without asking the user to enter any CAPTCHA data.

It may not be possible, but I thought I'd ask.

Comments

ebeyrent’s picture

+1

lasha11’s picture

Version: 7.x-1.1 » 6.x-1.2
jamesoakley’s picture

Version: 6.x-1.2 » 7.x-1.x-dev

@lasha11 - it is normal to develop new features like this for the latest version of Drupal, then to backport them to Drupal 6.x later. IMO, the correct version of this issue should be 7.x-1.x-dev, which is not to deny its usefulness for Drupal 6 too.

fuzzy76’s picture

+1

jhibbets’s picture

I would like to add some thoughts here as we've seen some pretty heavy SPAM user accounts on opensource.com. At our peak, we were getting several per minute, thankfully, that's subsided. Now were down to a certain few [spam accounts] a day and others that are questionable [because they look suspicious and never complete the registration process].

In our findings, we believe that a lot of this is caused for blackhat SEO purposes, the spam accounts are just trying to get a link on the site.

I think one solution to this would be to have a common database of emails detected as spam. For example, if we block a user on our site (ideally, there would be an option for block user as spam), feedback is sent to mollom to collect these addresses. There is a threshold each site could set, say we set our variable at 10. If 10 other sites have marked the email as spam, their unable to complete the registration form on our site. Collectively, all Drupal sites using mollom could help build up this database, but have the flexibility to 1) use it for user registration (and probably commenting) and 2) control the threshold variable.

I'd love to hear other peoples thoughts about this idea and if it would work.

I imagine that a lot of the higher traffic sites would still get hit, but maybe this solution helps everyone, especially the longtail of sites with less registration traffic.

Regards,
Jason

rbayliss’s picture

+1 for this.

sun’s picture

Title: Protect User Registration Form without resorting to CAPTCHA » Allow to protect forms without text fields with text analysis without resorting to CAPTCHA (e.g., user registration form)
Version: 7.x-1.x-dev » 7.x-2.x-dev
Assigned: Unassigned » sun
Status: Active » Needs review
StatusFileSize
new14.83 KB

Let's see how far we get. I expect a couple of failures in tests which verify that this isn't possible currently.

Status: Needs review » Needs work

The last submitted patch, mollom.analysis-empty.7.patch, failed testing.

sun’s picture

Status: Needs work » Needs review
StatusFileSize
new15.66 KB

Removed the assertions from tests.

sun’s picture

StatusFileSize
new32.2 KB

Adding tests required me to include fixes for #1034442: no records of user registration form text analysis in mollom db table

The new tests will throw test failures, since the Mollom backend needs to be adjusted first.

Status: Needs review » Needs work

The last submitted patch, mollom.analysis-empty.10.patch, failed testing.

sun’s picture

Status: Needs work » Needs review
StatusFileSize
new38.54 KB
+++ b/mollom.install
@@ -172,6 +172,7 @@ function mollom_schema() {
+        // @todo Change to NULL.

Moved these todos into #1818458: Remove {mollom} schema default values for reason and languages

For now, I'll comment out the failing tests, since this patch can technically land before the Mollom API officially supports this.

That said, we need to make sure (as in: test) that the suggested protection mode for the user registration/profile form defaults to CAPTCHA. Done so in attached patch.

Further testing also revealed that reporting user accounts is broken currently. Had to invent a new 'report path' concept for reporting entities through a report link in an e-mail notification. Added tests and docs for that.

sun’s picture

For the sake of patch reviews, here's #12 ignoring white-space changes.

sun’s picture

StatusFileSize
new4.13 KB

Committed and pushed #12 to 7.x-2.x.

Attached patch removes the commented out test assertions, which will pass as soon as Mollom's REST Testing API has been updated.

Status: Needs review » Needs work

The last submitted patch, mollom.user-analysis-type-test.14.patch, failed testing.

sun’s picture

Status: Needs work » Needs review
StatusFileSize
new10.02 KB

Now including additional tests for the hosted Mollom moderation system integration.

Status: Needs review » Needs work

The last submitted patch, mollom.user-analysis-type-test.16.patch, failed testing.

sun’s picture

Status: Needs work » Needs review
sun’s picture

StatusFileSize
new10.01 KB

Re-rolled #16 against HEAD, and removed the Mollom server override for the tests.

Status: Needs review » Needs work

The last submitted patch, mollom.user-analysis-type-test.19.patch, failed testing.

sun’s picture

Status: Needs work » Needs review
StatusFileSize
new10.01 KB

Looks like the testing server responses are not fixed yet.

Status: Needs review » Needs work

The last submitted patch, mollom.user-analysis-type-test.21.patch, failed testing.

sun’s picture

Status: Needs work » Needs review
StatusFileSize
new11.34 KB

All tests are passing locally for me as of today.

Status: Needs review » Needs work

The last submitted patch, mollom.user-analysis-type-test.23.patch, failed testing.

sun’s picture

Status: Needs work » Needs review
StatusFileSize
new10.91 KB

Final adjustments.

sun’s picture

Version: 7.x-2.x-dev » 6.x-2.x-dev
Status: Needs review » Patch (to be ported)

Thanks for reporting, reviewing, and testing! Committed to 7.x-2.x.

A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.

We might want to consider to backport this to 6.x-2.x, but not planning to do that for now.

sun’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new38.8 KB

First pass. Only includes #12.

I expect (tons of) test failures, but let's see.

Status: Needs review » Needs work

The last submitted patch, 1250614-analysis.patch, failed testing.

sun’s picture

Status: Needs work » Needs review
StatusFileSize
new39.72 KB

Status: Needs review » Needs work

The last submitted patch, 1250614-analysis.patch, failed testing.

sun’s picture

Status: Needs work » Needs review
StatusFileSize
new46.27 KB

Hrm... this is quite the challenge to backport to D6 :)

Backported the hook_entity_CRUD() functions from D7 to D6 as private functions, and invoking them from the individual API integration hooks now. Seems to work fine in manual testing. Let's see how this affects tests.

Status: Needs review » Needs work

The last submitted patch, 1250614-analysis.patch, failed testing.

sun’s picture

Oh wow, I just spotted this fancy gimmick in D6's user_register_submit():

  if (!$admin && array_intersect(array_keys($form_state['values']), array('uid', 'roles', 'init', 'session', 'status'))) {
    watchdog('security', 'Detected malicious attempt to alter protected user fields.', array(), WATCHDOG_WARNING);
    $form_state['redirect'] = 'user/register';
    return;
  }

user_save() does not invoke a hook prior to inserting the new user record.

These two issues combined unfortunately mean that this facility cannot be backported. :-/

However, I will still backport the architectural changes, since those are helpful for the Mollom moderation system integration, because those are already done now, and in general, keeping the code in sync between D7 and D6 simplifies future backports.

sun’s picture

Status: Needs work » Needs review
StatusFileSize
new45.52 KB
sun’s picture

StatusFileSize
new45.74 KB
sun’s picture

Committed and pushed to 6.x-2.x.

Now the follow-up patch from #25.

sun’s picture

Status: Needs review » Fixed

Committed and pushed to 6.x-2.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 5f1445a on 7.x-2.x, 8.x-2.x, fbajs, actions by sun:
    - #1250614 by sun: Allow to protect user registration form with text...
  • Commit 615a0b1 on 7.x-2.x, 8.x-2.x, fbajs, actions by sun:
    - #1250614 by sun: Allow to protect user registration form with text...
  • Commit f666243 on 7.x-2.x, 8.x-2.x, fbajs, actions by sun:
    - #1250614 by sun: Allow to protect forms without text fields with text...

  • Commit 5f1445a on 7.x-2.x, 8.x-2.x, fbajs, actions by sun:
    - #1250614 by sun: Allow to protect user registration form with text...
  • Commit 615a0b1 on 7.x-2.x, 8.x-2.x, fbajs, actions by sun:
    - #1250614 by sun: Allow to protect user registration form with text...
  • Commit f666243 on 7.x-2.x, 8.x-2.x, fbajs, actions by sun:
    - #1250614 by sun: Allow to protect forms without text fields with text...