Skip to content
Snippets Groups Projects
Commit 55b20f00 authored by Uma's avatar Uma
Browse files

Fixes #1220 XSS vulnerability with CKEditor field is addressed

parent 3e31cb61
No related branches found
No related tags found
1 merge request!509Fixes #1220 XSS vulnerability with CKEditor field is addressed
...@@ -78,8 +78,9 @@ class Users_Save_Action extends Vtiger_Save_Action { ...@@ -78,8 +78,9 @@ class Users_Save_Action extends Vtiger_Save_Action {
} }
if($fieldName == 'signature' && $fieldValue !== null){ if($fieldName == 'signature' && $fieldValue !== null){
$fieldValue = $request->getRaw($fieldName); $fieldValue = $request->getRaw($fieldName);
$processedContent = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $fieldValue); $purifiedContent = vtlib_purify(decode_html($fieldValue));
$fieldValue = to_html(purifyHtmlEventAttributes($processedContent,TRUE)); // Purify malicious html event attributes
$fieldValue = purifyHtmlEventAttributes(decode_html($purifiedContent),true);
} }
if($fieldValue !== null) { if($fieldValue !== null) {
......
...@@ -162,8 +162,9 @@ class Vtiger_Save_Action extends Vtiger_Action_Controller { ...@@ -162,8 +162,9 @@ class Vtiger_Save_Action extends Vtiger_Action_Controller {
} }
if($fieldName == 'notecontent' && $fieldValue !== null){ if($fieldName == 'notecontent' && $fieldValue !== null){
$fieldValue = $request->getRaw($fieldName); $fieldValue = $request->getRaw($fieldName);
$processedContent = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $fieldValue); $purifiedContent = vtlib_purify(decode_html($fieldValue));
$fieldValue = to_html(purifyHtmlEventAttributes($processedContent,TRUE)); // Purify malicious html event attributes
$fieldValue = purifyHtmlEventAttributes(decode_html($purifiedContent),true);
} }
if($fieldValue !== null) { if($fieldValue !== null) {
if(!is_array($fieldValue) && $fieldDataType != 'currency') { if(!is_array($fieldValue) && $fieldDataType != 'currency') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment