eval() call detected
High
- Category
- Dangerous Code Execution
- Content
for key, value in context.items(): condition = condition.replace(f"${key}", str(value)) # 执行条件判断(简化实现) if eval(condition, {"__builtins__": {}}, {}): rule['trigger_count'] += 1 matched_rules.append(rule) # 更新触发次数- Confidence
- 99% confidence
- Finding
- The code evaluates rule conditions from stored JSON using Python eval() after only doing string substitution. Even with __builtins__ removed, dynamic evaluation of attacker-controlled expressions is unsafe and can still enable denial of service, logic manipulation, and potentially sandbox bypasses depending on interpreter behavior and reachable objects. In this skill, rules are persisted and auto-generated from project data, which increases the chance that untrusted input can reach the evaluator.
