diff options
author | Gabor Hojtsy <gabor@hojtsy.hu> | 2016-02-24 20:20:15 +0100 |
---|---|---|
committer | Gabor Hojtsy <gabor@hojtsy.hu> | 2016-02-24 20:20:15 +0100 |
commit | 18f1c229fcb87b1a1f94fcb1f0785ba3d40fc402 (patch) | |
tree | 82d672e7e57f2983301ed5539a53c0a2a4fba534 /includes/xmlrpcs.inc | |
parent | 756b9f40ceec48c0c3cd0b2d2c50aca5fc911e66 (diff) | |
download | drupal-6.x.tar.gz drupal-6.x.zip |
Drupal 6.38 (SA-CORE-2016-001) by agerard, Alan Evans, benjy, catch, chx, dalin, Damien Tournoud, DamienMcKenna, Dave Cohen, Dave Reid, David Jardin, David_Rothstein, dmitrig01, dsnopek, effulgentsia, fgm, greggles, Gábor Hojtsy, Harry Taheem, Heine, John Morahan, Juho Nurminen 2NS, klausi, larowlan, nagba, Pere Orga, plach, pwolanin, quicksketch, rickmanelius, scor, sun, Tarpinder Grewal, YesCT6.386.x
Diffstat (limited to 'includes/xmlrpcs.inc')
-rw-r--r-- | includes/xmlrpcs.inc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/includes/xmlrpcs.inc b/includes/xmlrpcs.inc index 049a92b86738..18e5ac70e661 100644 --- a/includes/xmlrpcs.inc +++ b/includes/xmlrpcs.inc @@ -213,6 +213,10 @@ function xmlrpc_server_call($xmlrpc_server, $methodname, $args) { function xmlrpc_server_multicall($methodcalls) { // See http://www.xmlrpc.com/discuss/msgReader$1208 + // To avoid multicall expansion attacks, limit the number of duplicate method + // calls allowed with a default of 1. Set to -1 for unlimited. + $duplicate_method_limit = variable_get('xmlrpc_multicall_duplicate_method_limit', 1); + $method_count = array(); $return = array(); $xmlrpc_server = xmlrpc_server_get(); foreach ($methodcalls as $call) { @@ -222,10 +226,14 @@ function xmlrpc_server_multicall($methodcalls) { $ok = FALSE; } $method = $call['methodName']; + $method_count[$method] = isset($method_count[$method]) ? $method_count[$method] + 1 : 1; $params = $call['params']; if ($method == 'system.multicall') { $result = xmlrpc_error(-32600, t('Recursive calls to system.multicall are forbidden.')); } + elseif ($duplicate_method_limit > 0 && $method_count[$method] > $duplicate_method_limit) { + $result = xmlrpc_error(-156579, t('Too many duplicate method calls in system.multicall.')); + } elseif ($ok) { $result = xmlrpc_server_call($xmlrpc_server, $method, $params); } |