Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Contact and Register pages do not validate

#116

The contact and register pages do not validate as XHMTL 1.0 Strict, mostly due to the ReCAPTCHA.

To solve this we will probably have to use a different anti-spam approach.

Reported by Matias Korhonen · May 12th, 2009 @ 12:09 PM

State: resolved
Assigned to: Matias Korhonen Matias Korhonen

Activity

  1. Matias Korhonen
    Matias Korhonen
    • State changed from new to open

    I've just spent an inordinate amount of time looking at different anti-bot solutions for Rails and I haven't managed to find anything we'd actually want to use.

    The best I idea I have at the moment is to implement out own solution.

    May 14th, 2009 @ 10:24 PM

  2. Matias Korhonen
    Matias Korhonen
    • Assigned user set to Matias Korhonen

    May 14th, 2009 @ 10:24 PM

  3. Matias Korhonen
    Matias Korhonen

    How about something like this for a simple math problem? It isn't really complicated, but I think our site is small enough for it to be sufficient.

    def math_puzzle
        number1 = rand(10)
        number2 = rand(10)
        operator = rand(3)
        salt = MATH_SALT
        
        case operator
            when 0
              question = "What is " + number1.to_s + " multiplied by " + number2.to_s + "?"
              answer = number1 * number2
            when 1
              question = "What is " + number1.to_s + " plus " + number2.to_s + "?"
              answer = number1 + number2
            when 2
              question = "What is " + number1.to_s + " minus " + number2.to_s + "?"
              answer = number1 - number2
        end
    
        answer_hash = Digest::SHA1.hexdigest("#{salt}:#{answer.to_s}")
    
        {:question => question, :answer_hash => answer_hash}
    end
      
    def verify_answer?(user_answer, answer_hash)
      salt = MATH_SALT
      user_hash = Digest::SHA1.hexdigest("#{salt}:#{user_answer.to_s}")
      
      if user_hash == answer_hash
        return true
      else
        return false
      end
    end
    

    I believe there's a plugin or gem which allows you to convert integers into words, so we could use that to make it harder to parse...

    May 14th, 2009 @ 11:48 PM

  4. Matias Korhonen
    Matias Korhonen

    We're being too clever about this. Our site isn't some high volume site that's going to get lots of attempts to create new users. What we will get are random bots that try their luck...

    I think we should use negative captchas instead of bothering the user.

    See the Ruby on Rails Security Guide - 7.3 CAPTCHAs

    And Ned Batchelder’s blog post

    I propose that we use a combination of a couple of honey pots and a time stamp.

    If you can figure out an easy way of doing it, we could randomize the field names (there's a plugin called 'Negative Captcha', but you have to change a lot of things to use it).

    May 15th, 2009 @ 12:31 AM

  5. Matias Korhonen
    Matias Korhonen

    Or we could solve this and #101 Validate email addresses by sending a validation email... (at least for the registration page)

    May 16th, 2009 @ 02:46 PM

  6. Joao Carlos
    Joao Carlos
    • Assigned user changed from Matias Korhonen to Joao Carlos

    August 20th, 2009 @ 08:14 PM

  7. Matias Korhonen
    Matias Korhonen
    • Assigned user changed from Joao Carlos to Matias Korhonen

    September 3rd, 2009 @ 01:01 PM

  8. Matias Korhonen
  9. Joao Carlos
  10. Matias Korhonen
    Matias Korhonen
    • State changed from open to testing

    September 7th, 2009 @ 04:09 PM

  11. Matias Korhonen
  12. Matias Korhonen
    Matias Korhonen
    • State changed from testing to resolved

    September 8th, 2009 @ 07:37 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.