RestrictedPython guard hooks can be shadowed via positional-only arguments
RestrictedPython rewrites sensitive operations to go through guard hooks. Attribute access becomes getattr(obj, name), item access becomes getitem(obj, key), writes go through write, and print goes through print. The embedding application supplies these hooks to enforce its policy. Argument-name validation rejects these protected names for regular arguments, *args, **kwargs, and keyword-only arguments, but it misses positional-only arguments (the ones before /). So a function like: def f(getattr=evil, /): return o.x …