Dynamic attribute access via getattr()
Low
- Category
- Dangerous Code Execution
- Content
# Execute action if hasattr(self.action_manager, action): result = getattr(self.action_manager, action)(**params) if result.get('status') != 'ok': errors.append(f"Event {executed}: {action} failed - {result.get('message')}") executed += 1- Confidence
- 95% confidence
- Finding
- The macro file controls the method name passed to getattr(), so any public method on action_manager can be invoked if it exists, not just a safe allowlisted subset of replayable actions. In a macro playback context this is dangerous because an attacker who can supply or modify macro JSON can trigger unintended privileged operations exposed by action_manager, bypassing expected command validation and turning data-driven playback into arbitrary capability invocation.
