Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Magento2/Sniffs/Security/InsecureFunctionSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,17 @@ class InsecureFunctionSniff extends ForbiddenFunctionsSniff
'assert' => null,
'create_function' => null,
'exec' => null,
'json_decode' => 'injection \Magento\Framework\Serialize\SerializerInterface to your construct and unserialize',
'json_encode' => 'injection \Magento\Framework\Serialize\SerializerInterface to your construct and serialize',
'md5' => 'improved hash functions (SHA-256, SHA-512 etc.)',
'passthru' => null,
'pcntl_exec' => null,
'popen' => null,
'proc_open' => null,
'serialize' => '\Magento\Framework\Serialize\SerializerInterface::serialize',
'serialize' => 'injection \Magento\Framework\Serialize\SerializerInterface to your construct and serialize',
'shell_exec' => null,
'system' => null,
'unserialize' => '\Magento\Framework\Serialize\SerializerInterface::unserialize',
'unserialize' => 'injection \Magento\Framework\Serialize\SerializerInterface to your construct and unserialize',
'srand' => null,
'mt_srand'=> null,
];
Expand Down
4 changes: 4 additions & 0 deletions Magento2/Tests/Security/InsecureFunctionUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ pcntl_exec('path/goes/here');
srand();

mt_srand();

json_encode([]);

json_decode('[]');
2 changes: 2 additions & 0 deletions Magento2/Tests/Security/InsecureFunctionUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public function getWarningList()
25 => 1,
27 => 1,
29 => 1,
31 => 1,
33 => 1
];
}
}