croaky/email_validator — pull request #1 by croaky (2013-03-26 18:01:37+00:00)
Title: Regular expression fix

In Ruby, `^` and `$` match the line beginning and line end. So, an email
coming in via HTTP like this:

user@example.com%0A

Whereas %0A is a line feed in URL encoding, so Rails automatically converts
it to:

user@example.com\n

and unintentionally passes validation because the regular expression matched
the email: up to the line end, the rest does not matter.

http://guides.rubyonrails.org/security.html#regular-expressions