mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
FIX #yogosha5757
This commit is contained in:
@@ -316,6 +316,7 @@ class SecurityTest extends PHPUnit\Framework\TestCase
|
||||
$_GET["param4"]='../dir';
|
||||
$_GET["param5"]="a_1-b";
|
||||
$_POST["param6"]=""><svg onload='console.log("123")'>";
|
||||
$_POST["param6b"]='<<<../>../>../svg><<<../>../>../animate =alert(1)>abc';
|
||||
$_GET["param7"]='"c:\this is a path~1\aaan" abc<bad>def</bad>';
|
||||
$_POST["param8a"]="Hacker<svg onload='console.log("123")'"; // html tag is not closed so it is not detected as html tag but is still harmfull
|
||||
$_POST['param8b']='<img src=x onerror=alert(document.location) t='; // this is html obfuscated by non closing tag
|
||||
@@ -386,6 +387,10 @@ class SecurityTest extends PHPUnit\Framework\TestCase
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals('">', $result);
|
||||
|
||||
$result=GETPOST("param6b");
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals('abc', $result);
|
||||
|
||||
// With restricthtml we must remove html open/close tag and content but not htmlentities like n
|
||||
|
||||
$result=GETPOST("param7", 'restricthtml');
|
||||
|
||||
Reference in New Issue
Block a user