Fix XSS injection into textarea

This commit is contained in:
Laurent Destailleur
2019-09-18 14:44:31 +02:00
parent e52788eb75
commit 00d5cff00d

View File

@@ -116,6 +116,8 @@ function testSqlAndScriptInject($val, $type)
$inj += preg_match('/union.+select/i', $val); $inj += preg_match('/union.+select/i', $val);
$inj += preg_match('/(\.\.%2f)+/i', $val); $inj += preg_match('/(\.\.%2f)+/i', $val);
} }
// For XSS Injection done by closing textarea to exucute content into a textarea field
$inj += preg_match('/<\/textarea/i', $val);
// For XSS Injection done by adding javascript with script // For XSS Injection done by adding javascript with script
// This is all cases a browser consider text is javascript: // This is all cases a browser consider text is javascript:
// When it found '<script', 'javascript:', '<style', 'onload\s=' on body tag, '="&' on a tag size with old browsers // When it found '<script', 'javascript:', '<style', 'onload\s=' on body tag, '="&' on a tag size with old browsers