Skip to content

Commit

Permalink
fix bug for param from list
Browse files Browse the repository at this point in the history
  • Loading branch information
LoRexxar committed Jan 5, 2022
1 parent a1f3fa7 commit 9d2d207
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions core/core_engine/php/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,14 @@ def parameters_back(param, nodes, function_params=None, lineno=0,
if param_name in param_expr:
logger.debug("[AST] param {} in list {}, continue...".format(param_name, param_expr))

# 如果列表中直接就有可控变量,先算作漏洞
for p in param_expr:
is_co, cp = is_controllable(p)

if is_co == 1:
param = p
return is_co, cp, expr_lineno

is_co = 3
cp = param

Expand Down
2 changes: 1 addition & 1 deletion core/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ def store(result):
logger.debug('[SCAN] [STORE] Not found vulnerabilities on this rule!')

async def start_scan(target_directory, rule, files, language, tamper_name):

result = scan_single(target_directory, rule, files, language, tamper_name, is_unconfirm, newcore_function_list)
store(result)

Expand Down Expand Up @@ -444,6 +443,7 @@ def origin_results(self):
if match:
f = FileParseAll(self.files, self.target_directory, language=self.lan)
result = f.grep(match)

else:
result = None
except Exception as e:
Expand Down

0 comments on commit 9d2d207

Please sign in to comment.