Dynamic attribute access via getattr()
Low
- Category
- Dangerous Code Execution
- Content
def import_string(path: str) -> Any: module_name, attr_name = path.rsplit(".", 1) module = importlib.import_module(module_name) return getattr(module, attr_name) def load_get_client() -> Callable[..., Any]:- Confidence
- 86% confidence
- Finding
- The module and attribute used to obtain the client factory are taken from environment-controlled values and then imported via importlib/getattr without any allowlist. If an attacker can influence .env.local or process environment, they can cause arbitrary Python module loading and invoke attacker-chosen code during runtime, which is effectively code execution in the skill context.
