Description
The legacy bridge stores lazy callable-module initializers in an ordinary object and reads it by arbitrary module name. Unregistered names such as constructor and __proto__ therefore resolve through Object.prototype; getCallableModule('constructor') invokes the inherited constructor and returns an object although no module was registered. Assigning __proto__ also changes the registry prototype instead of creating a normal module entry.
Expected behavior
Only explicitly registered callable modules should resolve, and every valid string name—including __proto__—should be registrable.
React Native Version
0.87.1 and current main
Affected Platforms
Runtime - All
Description
The legacy bridge stores lazy callable-module initializers in an ordinary object and reads it by arbitrary module name. Unregistered names such as
constructorand__proto__therefore resolve throughObject.prototype;getCallableModule('constructor')invokes the inherited constructor and returns an object although no module was registered. Assigning__proto__also changes the registry prototype instead of creating a normal module entry.Expected behavior
Only explicitly registered callable modules should resolve, and every valid string name—including
__proto__—should be registrable.React Native Version
0.87.1 and current main
Affected Platforms
Runtime - All