eval() call detected
High
- Category
- Dangerous Code Execution
- Content
fig, ax = plt.subplots(figsize=(10, 6)) f = eval(f"lambda x: {function_str}") # 绘制函数 x_smooth = np.linspace(a, b, 200)- Confidence
- 99% confidence
- Finding
- This code builds a lambda from a user-controlled string using eval, which allows arbitrary Python code execution in the process context rather than merely evaluating a math expression. In an educational plotting tool, that capability is unnecessary and materially expands the attack surface to file access, subprocess execution, and environment inspection.
