PyTorch locks down export load against unsafe operator names
A security fix makes torch.export.load reject disallowed operators; regression coverage is being extended to the load path.
PyTorch has tightened torch.export.load so it refuses serialized payloads that name operators outside an allowed set, closing a security gap in how exported models are rehydrated.
The load path now treats unsafe as_operator names as errors: non-torch callables, aliases under namespaces such as torch.builtins or torch.os, and torch-looking names that do not actually resolve. Those cases are meant to raise SerializeError rather than proceed.
Existing tests had covered failures on the save side only. Maintainers are adding load-side checks that write deliberately bad payloads and assert rejection, so the security fix cannot regress silently. Anyone loading untrusted export artifacts is the audience this matters for: without the guard, a crafted package could steer execution toward operators the runtime should never invoke from import alone.