Skip Menu |

This queue is for tickets about the Mail-Box CPAN distribution.

Report information
The Basics
Id: 69414
Status: resolved
Priority: 0/
Queue: Mail-Box

People
Owner: Nobody in particular
Requestors: yyang [...] proofpoint.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 2.090
Fixed in: (no value)



Subject: invalid long charset causing Mail::Message::Field stack overflow
Looks like that this issue has been there for some time. An invalid extremely long charset (sample message attached) will make Mail::Message::Field stack overflow. Changing the regex in attribute() fixed it. --- Mail/Message/Field.pm~ 2011-02-16 17:07:48.000000000 -0800 +++ Mail/Message/Field.pm 2011-06-28 20:44:23.000000000 -0700 @@ -254,7 +254,7 @@ (my $quoted = $value) =~ s/(["\\])/\\$1/g; for($body) - { s/\b$attr\s*=\s*"(?>[^\\"]|\\.)*"/$attr="$quoted"/i + { s/\b$attr\s*=\s*"(?>[^\\"]|\\.){0,2048}"/$attr="$quoted"/i or s/\b$attr\s*=\s*[^;\s]*/$attr="$quoted"/i or do { $_ .= qq(; $attr="$quoted") } }
Subject: invalid-long-charset.eml
Download invalid-long-charset.eml
message/rfc822 643.6k

Message body is not shown because it is too large.

I totally overlooked this bug-report. The MTU is also to blame: it should not pass header lines that long. The body lines are restricted to 998 characters... I do not know the exact max length of header lines, but certainly not higher. Thanks for your contribution, sorry for the delay.