]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 793826: Prevent private web service methods from being called
authorKoosha Khajeh Moogahi <koosha.khajeh@gmail.com>
Fri, 12 Oct 2012 17:46:07 +0000 (19:46 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Fri, 12 Oct 2012 17:46:07 +0000 (19:46 +0200)
r=dkl a=LpSolit

Bugzilla/WebService/Server.pm

index 5f179517812639753667350e919857c69edf4ba1..5634aa0fe6a4e30f4a7d6e089e3727f025179b7b 100644 (file)
@@ -17,7 +17,9 @@ use Scalar::Util qw(blessed);
 
 sub handle_login {
     my ($self, $class, $method, $full_method) = @_;
-    ThrowCodeError('unknown_method', {method => $full_method}) if !$class;
+    # Throw error if the supplied class does not exist or the method is private
+    ThrowCodeError('unknown_method', {method => $full_method}) if (!$class or $method =~ /^_/);
+
     eval "require $class";
     ThrowCodeError('unknown_method', {method => $full_method}) if $@;
     return if ($class->login_exempt($method)