Dynamic attribute access via getattr()
Low
- Category
- Dangerous Code Execution
- Content
# 填充缺失值 if fill_method: for key in list(panels.keys()): panels[key] = getattr(panels[key], fill_method)() # ── vwap ────────────────────────────────────────────────────────── vol_safe = panels["volume"].replace(0, np.nan)- Confidence
- 86% confidence
- Finding
- The code invokes a DataFrame method based on the caller-controlled fill_method string via getattr(), without restricting it to an allowlist. In this context an attacker who can influence that parameter could trigger unintended pandas methods, causing crashes, excessive resource use, or unexpected behavior instead of only safe missing-value filling.
