- Add guard in TypeError fallback path: raise ProtocolMismatchError when
issubclass raises TypeError and protocol has no inspectable members,
preventing silent True return for unverifiable protocols
- Update test scenario descriptions to accurately reflect the new
implementation (no instantiation occurs at any point)
- Update step definition comments to remove references to old
instantiation-based code paths
ISSUES CLOSED: #7418
Fixes#7418 - Security vulnerability where PluginLoader.validate_protocol()
instantiated arbitrary plugin classes with no-arg constructor, allowing
arbitrary code execution during validation.
Changes:
- Reversed validation order: use issubclass() first (safe, no instantiation)
- Only instantiate if structural check is insufficient
- Prevents constructor code execution from untrusted plugins
- Maintains protocol validation functionality
This prevents RCE attacks via malicious plugin constructors during the
validation phase.