Commit 33689864 authored by Frédéric Buclin's avatar Frédéric Buclin

Bug 1254226: XSS through javascript: callback URLs in auth delegation

r=dylan
parent c7e80318
...@@ -40,6 +40,8 @@ trick_taint($callback); ...@@ -40,6 +40,8 @@ trick_taint($callback);
trick_taint($description); trick_taint($description);
my $callback_uri = URI->new($callback); my $callback_uri = URI->new($callback);
$callback_uri->scheme =~ /^https?$/
or ThrowUserError('auth_delegation_illegal_protocol', { protocol => $callback_uri->scheme });
my $callback_base = $callback_uri->clone; my $callback_base = $callback_uri->clone;
$callback_base->query(undef); $callback_base->query(undef);
......
...@@ -122,6 +122,11 @@ ...@@ -122,6 +122,11 @@
This site does not have auth delegation enabled. This site does not have auth delegation enabled.
Please contact an administrator if you require this functionality. Please contact an administrator if you require this functionality.
[% ELSIF error == "auth_delegation_illegal_protocol" %]
[% title = "Invalid Protocol" %]
The callback URI uses an illegal protocol: <em>[% protocol FILTER html %]</em>.
Only <em>http</em> and <em>https</em> are allowed.
[% ELSIF error == "auth_delegation_missing_callback" %] [% ELSIF error == "auth_delegation_missing_callback" %]
[% title = "Auth delegation impossible without callback URI" %] [% title = "Auth delegation impossible without callback URI" %]
It looks like auth delegation was attempted, but no callback URI was passed. It looks like auth delegation was attempted, but no callback URI was passed.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment