Dynamic attribute access via getattr()
Low
- Category
- Dangerous Code Execution
- Content
sys.exit(1) cmd = sys.argv[1] args = sys.argv[2:] result = getattr(papyrus, cmd)(*args) print(result)- Confidence
- 93% confidence
- Finding
- Using getattr(papyrus, cmd)(*args) on untrusted command-line input allows invocation of any attribute or method exposed on the PapyrusTool instance, not just the intended public tool commands. An attacker could call internal methods like _run or trigger unexpected behavior and crashes, which broadens the attack surface and may enable abuse of the underlying external command runner.
