Scope
Port Bun corpus position 3987, js/third_party/grpc-js/test-prototype-pollution.test.ts.
Required contracts
- never traverse or assign
__proto__,prototype, orconstructorpackage path segments - preserve
Object.prototypewhen hostile package definitions are loaded - still materialize ordinary dotted package definitions instead of ignoring all arbitrary input
- use own-property definitions so inherited setters cannot intercept package construction
Verification
- focused upstream file passes both pollution cases
- permanent diagnostics prove hostile paths are discarded and safe paths remain loadable
- existing gRPC, SQL adapter, and third-party gates remain green