From a460bda519dc96454d861de32406bd21b22bf698 Mon Sep 17 00:00:00 2001 From: Jose Orsini Date: Tue, 29 Jun 2021 14:37:13 -0500 Subject: [PATCH 1/4] MTS-2096: Added functions marked as insecure by Sec Team. --- Magento2/Sniffs/Security/InsecureFunctionSniff.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Magento2/Sniffs/Security/InsecureFunctionSniff.php b/Magento2/Sniffs/Security/InsecureFunctionSniff.php index b5253193..66b6f5f0 100644 --- a/Magento2/Sniffs/Security/InsecureFunctionSniff.php +++ b/Magento2/Sniffs/Security/InsecureFunctionSniff.php @@ -33,5 +33,19 @@ class InsecureFunctionSniff extends ForbiddenFunctionsSniff 'srand' => null, 'mt_srand' => null, 'mt_rand' => 'random_int', + // Custom Rules - MTS-2096 + 'eval' => null, + 'preg_replace' => null, + 'preg_replace_callback' => null, + 'preg_replace_callback_array' => null, + 'include' => null, + 'include_once' => null, + 'require' => null, + 'require_once' => null, + 'proc_nice' => null, + 'proc_open' => null, + 'proc_close' => null, + 'proc_terminate' => null, + 'proc_get_status' => null, ]; } From 0ab21436453cb30ab47540336e9fe4b1320c4f0d Mon Sep 17 00:00:00 2001 From: Jose Orsini Date: Tue, 29 Jun 2021 15:40:54 -0500 Subject: [PATCH 2/4] exclude vendor folder --- phpunit.xml.dist | 1 + 1 file changed, 1 insertion(+) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 6d1afb07..ecee1f73 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -8,4 +8,5 @@ + */vendor/* From cacb2dea8b612cc00059580029e8e4ce76ad29d0 Mon Sep 17 00:00:00 2001 From: Jose Orsini Date: Tue, 29 Jun 2021 16:09:07 -0500 Subject: [PATCH 3/4] discard --- phpunit.xml.dist | 1 - 1 file changed, 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index ecee1f73..6d1afb07 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -8,5 +8,4 @@ - */vendor/* From bd8c956301d22813945263770bf2572dc5dba361 Mon Sep 17 00:00:00 2001 From: Jose Orsini Date: Tue, 24 Aug 2021 16:58:07 -0500 Subject: [PATCH 4/4] Update list of functions to block --- Magento2/Sniffs/Security/InsecureFunctionSniff.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Magento2/Sniffs/Security/InsecureFunctionSniff.php b/Magento2/Sniffs/Security/InsecureFunctionSniff.php index 66b6f5f0..a4df7a76 100644 --- a/Magento2/Sniffs/Security/InsecureFunctionSniff.php +++ b/Magento2/Sniffs/Security/InsecureFunctionSniff.php @@ -35,13 +35,6 @@ class InsecureFunctionSniff extends ForbiddenFunctionsSniff 'mt_rand' => 'random_int', // Custom Rules - MTS-2096 'eval' => null, - 'preg_replace' => null, - 'preg_replace_callback' => null, - 'preg_replace_callback_array' => null, - 'include' => null, - 'include_once' => null, - 'require' => null, - 'require_once' => null, 'proc_nice' => null, 'proc_open' => null, 'proc_close' => null,