File tree Expand file tree Collapse file tree 9 files changed +43
-1
lines changed
lib/Magento/Mtf/Util/Protocol/CurlTransport Expand file tree Collapse file tree 9 files changed +43
-1
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ protected function authorize()
109109 $ isAuthorized = true ;
110110 $ _ENV ['app_backend_url ' ] = $ url ;
111111 break ;
112+ // phpcs:ignore Magento2.Exceptions.ThrowCatch
112113 } catch (\Exception $ e ) {
113114 continue ;
114115 }
Original file line number Diff line number Diff line change 99 *
1010 * @param string $token
1111 * @return bool
12+ *
13+ * phpcs:disable Squiz.Functions.GlobalFunction
1214 */
1315function authenticate ($ token )
1416{
17+ // phpcs:ignore Magento2.Security.IncludeFile
1518 require_once __DIR__ . '/../../../../app/bootstrap.php ' ;
1619
20+ // phpcs:ignore Magento2.Security.Superglobal
1721 $ magentoObjectManagerFactory = \Magento \Framework \App \Bootstrap::createObjectManagerFactory (BP , $ _SERVER );
22+ // phpcs:ignore Magento2.Security.Superglobal
1823 $ magentoObjectManager = $ magentoObjectManagerFactory ->create ($ _SERVER );
1924 $ tokenModel = $ magentoObjectManager ->get (\Magento \Integration \Model \Oauth \Token::class);
2025
Original file line number Diff line number Diff line change 1313
1414// phpcs:ignore Magento2.Security.Superglobal
1515if (!empty ($ _POST ['token ' ]) && !empty ($ _POST ['command ' ])) {
16+ // phpcs:ignore Magento2.Security.Superglobal
1617 if (authenticate (urldecode ($ _POST ['token ' ]))) {
18+ // phpcs:ignore Magento2.Security.Superglobal
1719 $ command = urldecode ($ _POST ['command ' ]);
1820 // phpcs:ignore Magento2.Security.Superglobal
1921 $ magentoObjectManagerFactory = \Magento \Framework \App \Bootstrap::createObjectManagerFactory (BP , $ _SERVER );
2022 // phpcs:ignore Magento2.Security.Superglobal
2123 $ magentoObjectManager = $ magentoObjectManagerFactory ->create ($ _SERVER );
2224 $ cli = $ magentoObjectManager ->create (\Magento \Framework \Console \Cli::class);
25+ // phpcs:ignore Magento2.Functions.DiscouragedFunction
2326 $ input = new StringInput (escapeshellcmd ($ command ));
2427 $ input ->setInteractive (false );
2528 $ output = new NullOutput ();
2629 $ cli ->doRun ($ input , $ output );
2730 } else {
31+ // phpcs:ignore Magento2.Security.LanguageConstruct
2832 echo "Command not unauthorized. " ;
2933 }
3034} else {
35+ // phpcs:ignore Magento2.Security.LanguageConstruct
3136 echo "'token' or 'command' parameter is not set. " ;
3237}
Original file line number Diff line number Diff line change 66// phpcs:ignore Magento2.Security.IncludeFile
77include __DIR__ . '/authenticate.php ' ;
88
9+ // phpcs:ignore Magento2.Security.Superglobal
910if (!empty ($ _POST ['token ' ]) && !empty ($ _POST ['path ' ])) {
11+ // phpcs:ignore Magento2.Security.Superglobal
1012 if (authenticate (urldecode ($ _POST ['token ' ]))) {
1113 // phpcs:ignore Magento2.Security.InsecureFunction
1214 exec ('rm -rf ../../../../generated/* ' );
1315 } else {
16+ // phpcs:ignore Magento2.Security.LanguageConstruct
1417 echo "Command not unauthorized. " ;
1518 }
1619} else {
20+ // phpcs:ignore Magento2.Security.LanguageConstruct
1721 echo "'token' parameter is not set. " ;
1822}
Original file line number Diff line number Diff line change 66// phpcs:ignore Magento2.Security.IncludeFile
77include __DIR__ . '/authenticate.php ' ;
88
9+ // phpcs:ignore Magento2.Security.Superglobal
910if (!empty ($ _POST ['token ' ]) && !empty ($ _POST ['template ' ])) {
11+ // phpcs:ignore Magento2.Security.Superglobal
1012 if (authenticate (urldecode ($ _POST ['token ' ]))) {
11- $ varDir = '../../../../var/ ' ;
13+ $ varDir = '../../../../var/export/ ' ;
14+ // phpcs:ignore Magento2.Security.Superglobal
1215 $ template = urldecode ($ _POST ['template ' ]);
1316 // phpcs:ignore Magento2.Functions.DiscouragedFunction
1417 $ fileList = scandir ($ varDir , SCANDIR_SORT_NONE );
3033 // phpcs:ignore Magento2.Security.LanguageConstruct, Magento2.Security.InsecureFunction
3134 echo serialize ($ files );
3235 } else {
36+ // phpcs:ignore Magento2.Security.LanguageConstruct
3337 echo "Command not unauthorized. " ;
3438 }
3539} else {
40+ // phpcs:ignore Magento2.Security.LanguageConstruct
3641 echo "'token' or 'template' parameter is not set. " ;
3742}
Original file line number Diff line number Diff line change 66// phpcs:ignore Magento2.Security.IncludeFile
77include __DIR__ . '/authenticate.php ' ;
88
9+ // phpcs:ignore Magento2.Security.Superglobal
910if (!empty ($ _POST ['token ' ])) {
11+ // phpcs:ignore Magento2.Security.Superglobal
1012 if (authenticate (urldecode ($ _POST ['token ' ]))) {
13+ // phpcs:ignore Magento2.Security.Superglobal
1114 if ($ _POST ['type ' ] == 'deployed ' ) {
15+ // phpcs:ignore Magento2.Security.Superglobal
1216 $ themePath = isset ($ _POST ['theme_path ' ]) ? $ _POST ['theme_path ' ] : 'adminhtml/Magento/backend ' ;
1317 $ directory = __DIR__ . '/../../../../pub/static/ ' . $ themePath ;
18+ // phpcs:ignore Magento2.Functions.DiscouragedFunction
1419 $ locales = array_diff (scandir ($ directory ), ['.. ' , '. ' ]);
1520 } else {
1621 // phpcs:ignore Magento2.Security.IncludeFile
2126 // phpcs:ignore Magento2.Security.LanguageConstruct
2227 echo implode ('| ' , $ locales );
2328 } else {
29+ // phpcs:ignore Magento2.Security.LanguageConstruct
2430 echo "Command not unauthorized. " ;
2531 }
2632} else {
33+ // phpcs:ignore Magento2.Security.LanguageConstruct
2734 echo "'token' parameter is not set. " ;
2835}
Original file line number Diff line number Diff line change 77// phpcs:ignore Magento2.Security.IncludeFile
88include __DIR__ . '/authenticate.php ' ;
99
10+ // phpcs:ignore Magento2.Security.Superglobal
1011if (!empty ($ _POST ['token ' ]) && !empty ($ _POST ['name ' ])) {
12+ // phpcs:ignore Magento2.Security.Superglobal
1113 if (authenticate (urldecode ($ _POST ['token ' ]))) {
14+ // phpcs:ignore Magento2.Security.Superglobal
1215 $ name = urldecode ($ _POST ['name ' ]);
1316 if (preg_match ('/\.\.( \\\|\/)/ ' , $ name )) {
1417 // phpcs:ignore Magento2.Exceptions.DirectThrow
1821 // phpcs:ignore Magento2.Security.InsecureFunction, Magento2.Functions.DiscouragedFunction, Magento2.Security.LanguageConstruct
1922 echo serialize (file_get_contents ('../../../../var/log ' . '/ ' . $ name ));
2023 } else {
24+ // phpcs:ignore Magento2.Security.LanguageConstruct
2125 echo "Command not unauthorized. " ;
2226 }
2327} else {
28+ // phpcs:ignore Magento2.Security.LanguageConstruct
2429 echo "'token' or 'name' parameter is not set. " ;
2530}
Original file line number Diff line number Diff line change 66// phpcs:ignore Magento2.Security.IncludeFile
77include __DIR__ . '/authenticate.php ' ;
88
9+ // phpcs:ignore Magento2.Security.Superglobal
910if (!empty ($ _POST ['token ' ]) && !empty ($ _POST ['path ' ])) {
11+ // phpcs:ignore Magento2.Security.Superglobal
1012 if (authenticate (urldecode ($ _POST ['token ' ]))) {
13+ // phpcs:ignore Magento2.Security.Superglobal
1114 $ path = urldecode ($ _POST ['path ' ]);
1215 // phpcs:ignore Magento2.Functions.DiscouragedFunction
1316 if (file_exists ('../../../../ ' . $ path )) {
1821 echo 'path exists: false ' ;
1922 }
2023 } else {
24+ // phpcs:ignore Magento2.Security.LanguageConstruct
2125 echo "Command not unauthorized. " ;
2226 }
2327} else {
28+ // phpcs:ignore Magento2.Security.LanguageConstruct
2429 echo "'token' or 'path' parameter is not set. " ;
2530}
Original file line number Diff line number Diff line change 66// phpcs:ignore Magento2.Security.IncludeFile
77include __DIR__ . '/authenticate.php ' ;
88
9+ // phpcs:ignore Magento2.Security.Superglobal
910if (!empty ($ _POST ['token ' ]) && !empty ($ _POST ['website_code ' ])) {
11+ // phpcs:ignore Magento2.Security.Superglobal
1012 if (authenticate (urldecode ($ _POST ['token ' ]))) {
13+ // phpcs:ignore Magento2.Security.Superglobal
1114 $ websiteCode = urldecode ($ _POST ['website_code ' ]);
1215 $ rootDir = '../../../../ ' ;
1316 $ websiteDir = $ rootDir . 'websites/ ' . $ websiteCode . '/ ' ;
3538 // phpcs:ignore Magento2.Functions.DiscouragedFunction
3639 file_put_contents ($ websiteDir . 'index.php ' , $ contents );
3740 } else {
41+ // phpcs:ignore Magento2.Security.LanguageConstruct
3842 echo "Command not unauthorized. " ;
3943 }
4044} else {
45+ // phpcs:ignore Magento2.Security.LanguageConstruct
4146 echo "'token' or 'website_code' parameter is not set. " ;
4247}
You can’t perform that action at this time.
0 commit comments