diff options
author | Dave Lawrence <dlawrence@mozilla.com> | 2012-02-24 22:39:29 +0100 |
---|---|---|
committer | Dave Lawrence <dlawrence@mozilla.com> | 2012-02-24 22:39:29 +0100 |
commit | 4098cc8be26a268bf561ff80f981a93c6959c678 (patch) | |
tree | 87940ec25918eb7505a3d7a495286867c72bf74c /Bugzilla/WebService/Server/XMLRPC.pm | |
parent | bf7f26d66089402df37036d1e62a6d8711922da1 (diff) | |
parent | 11fef47a1847cdfc5671dfc41447e893ed0037a5 (diff) | |
download | bugzilla-4098cc8be26a268bf561ff80f981a93c6959c678.tar.gz bugzilla-4098cc8be26a268bf561ff80f981a93c6959c678.tar.xz |
merged with bugzilla/4.2
Diffstat (limited to 'Bugzilla/WebService/Server/XMLRPC.pm')
-rw-r--r-- | Bugzilla/WebService/Server/XMLRPC.pm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Bugzilla/WebService/Server/XMLRPC.pm b/Bugzilla/WebService/Server/XMLRPC.pm index 5c3677993..822709d85 100644 --- a/Bugzilla/WebService/Server/XMLRPC.pm +++ b/Bugzilla/WebService/Server/XMLRPC.pm @@ -86,10 +86,18 @@ use XMLRPC::Lite; our @ISA = qw(XMLRPC::Deserializer); use Bugzilla::Error; +use Bugzilla::WebService::Constants qw(XMLRPC_CONTENT_TYPE_WHITELIST); use Scalar::Util qw(tainted); sub deserialize { my $self = shift; + + # Only allow certain content types to protect against CSRF attacks + if (!grep($_ eq $ENV{'CONTENT_TYPE'}, XMLRPC_CONTENT_TYPE_WHITELIST)) { + ThrowUserError('xmlrpc_illegal_content_type', + { content_type => $ENV{'CONTENT_TYPE'} }); + } + my ($xml) = @_; my $som = $self->SUPER::deserialize(@_); if (tainted($xml)) { |