Skip to content

Commit

Permalink
Fix XSS injection into textarea
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Sep 18, 2019
1 parent e52788e commit 00d5cff
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions htdocs/main.inc.php
Expand Up @@ -116,6 +116,8 @@ function testSqlAndScriptInject($val, $type)
$inj += preg_match('/union.+select/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
// 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
Expand Down

0 comments on commit 00d5cff

Please sign in to comment.