From: Frédéric Buclin Date: Tue, 31 Jan 2012 15:39:50 +0000 (+0100) Subject: Bug 714472: (CVE-2012-0448) [SECURITY] utf8 homoglyphs are allowed in email addresses... X-Git-Tag: bugzilla-4.2rc2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c81a8674ac77562584d5033561f8b4d947f23bb;p=thirdparty%2Fbugzilla.git Bug 714472: (CVE-2012-0448) [SECURITY] utf8 homoglyphs are allowed in email addresses, which could allow an attacker to be CC'ed to private bugs by accident r=glob a=LpSolit --- diff --git a/Bugzilla/FlagType.pm b/Bugzilla/FlagType.pm index ea81dfe467..b30065a1cf 100644 --- a/Bugzilla/FlagType.pm +++ b/Bugzilla/FlagType.pm @@ -310,7 +310,7 @@ sub _check_cc_list { # - do not contain any illegal character. foreach my $address (@addresses) { ($address =~ /^[\w\.\+\-=]+@[\w\.\-]+\.[\w\-]+$/ - && $address !~ /[\\\(\)<>&,;:"\[\] \t\r\n]/) + && $address !~ /[\\\(\)<>&,;:"\[\] \t\r\n\P{ASCII}]/) || ThrowUserError('illegal_email_address', {addr => $address, default => 1}); } diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm index 4c268552b4..6d8622e043 100644 --- a/Bugzilla/Util.pm +++ b/Bugzilla/Util.pm @@ -565,7 +565,7 @@ sub generate_random_password { sub validate_email_syntax { my ($addr) = @_; my $match = Bugzilla->params->{'emailregexp'}; - my $ret = ($addr =~ /$match/ && $addr !~ /[\\\(\)<>&,;:"\[\] \t\r\n]/); + my $ret = ($addr =~ /$match/ && $addr !~ /[\\\(\)<>&,;:"\[\] \t\r\n\P{ASCII}]/); if ($ret) { # We assume these checks to suffice to consider the address untainted. trick_taint($_[0]); diff --git a/template/en/default/global/code-error.html.tmpl b/template/en/default/global/code-error.html.tmpl index 5dce169768..f100df994e 100644 --- a/template/en/default/global/code-error.html.tmpl +++ b/template/en/default/global/code-error.html.tmpl @@ -48,8 +48,7 @@ [% ELSE %] [%+ Param('emailregexpdesc') FILTER html_light %] [% END %] - It must also not contain any of these special characters: - \ ( ) & < > , ; : " [ ], or any whitespace. + It also must not contain any illegal characters. [% ELSIF error == "authres_unhandled" %] The result value of [% value FILTER html %] was not handled by diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index 723f920426..dc0a94ac7f 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -851,9 +851,8 @@ [% ELSE %] [%+ Param('emailregexpdesc') FILTER html_light %] [% END %] - It must also not contain any of these special characters: - \ ( ) & < > , ; : " [ ], or any whitespace. - + It also must not contain any illegal characters. + [% ELSIF error == "illegal_frequency" %] [% title = "Too Frequent" %] Unless you are an administrator, you may not create series which are