fixes #871, CVE-2018-7722 strip tags on methods pwg.categories.add, pwg.categories.setInfo, pwg.images.setInfo

Adding pwg_token would be a better solution but would break remote applications (like the iOS app)
This commit is contained in:
plegall
2018-07-06 18:29:41 +02:00
parent bef09018fb
commit 23fa4c1a73
2 changed files with 8 additions and 3 deletions
+5 -3
View File
@@ -565,11 +565,12 @@ function ws_categories_add($params, &$service)
if (!empty($params['comment'])) if (!empty($params['comment']))
{ {
$options['comment'] = $params['comment']; // TODO do not strip tags if pwg_token is provided (and valid)
$options['comment'] = strip_tags($params['comment']);
} }
$creation_output = create_virtual_category( $creation_output = create_virtual_category(
$params['name'], strip_tags($params['name']), // TODO do not strip tags if pwg_token is provided (and valid)
$params['parent'], $params['parent'],
$options $options
); );
@@ -634,7 +635,8 @@ SELECT *
if (isset($params[$key])) if (isset($params[$key]))
{ {
$perform_update = true; $perform_update = true;
$update[$key] = $params[$key]; // TODO do not strip tags if pwg_token is provided (and valid)
$update[$key] = strip_tags($params[$key]);
} }
} }
+3
View File
@@ -1648,6 +1648,9 @@ SELECT *
$params[$key] = strip_tags($params[$key], '<b><strong><em><i>'); $params[$key] = strip_tags($params[$key], '<b><strong><em><i>');
} }
// TODO do not strip tags if pwg_token is provided (and valid)
$params[$key] = strip_tags($params[$key]);
if ('fill_if_empty' == $params['single_value_mode']) if ('fill_if_empty' == $params['single_value_mode'])
{ {
if (empty($image_row[$key])) if (empty($image_row[$key]))