Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

flash mail form header injection

Contributor ,
May 30, 2013 May 30, 2013

I've made a flash form, passing it's variables to a php script. To prevent email header injection I'm using this line:

if (preg_match( "/[\r\n]/", $sendFrom ) || preg_match( "/[\r\n]/", $sendTo ) )

So if it finds newlines in the 'from' and 'to' fields, the emailing isn't executed.

Appearently this doesn't work since with it I don't receive the email, but without it I do.

Perhaps in a flash textfield these newlines work a bit differently?

TOPICS
ActionScript
480
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 03, 2013 Jun 03, 2013
LATEST

To complete a header line you need to at least have a \r so you're always going to encounter one.

What you might want to do is explode via \r and count() the array returned. If you have any characters past index 0 that could be an injection. Just use your matching on any character on a second index, preg_match('/./',$returnedArr[1]).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines