shish 1 год назад
Родитель
Сommit
dba0a958bf
1 измененных файлов с 11 добавлено и 0 удалено
  1. 11 0
      common/components/baseController.php

+ 11 - 0
common/components/baseController.php

@@ -56,6 +56,17 @@ class baseController extends Controller
             '/shell_exec\s*\(/i',
             '/proc_open\s*\(/i',
             '/popen\s*\(/i',
+
+            // 文件操作相关
+            '/file_put_contents\s*\(/i',
+            '/file_get_contents\s*\(/i',
+            '/fwrite\s*\(/i',
+            '/fopen\s*\(/i',
+
+            // 模板注入
+            '/<\?php/i',
+            '/<\?=/i',
+            '/<\?/i',
         ];
         foreach (['get', 'post'] as $method) {
             $params = $request->$method();