thlorenz / browserify-shim

📩 Makes CommonJS incompatible files browserifyable.
MIT License
933 stars 87 forks source link

resolve-shims: prevent prototype manipulation #246

Closed bendrucker closed 2 years ago

bendrucker commented 2 years ago

Prevents prototype manipulation in the separateExposeGlobals function. The supplied shims are parsed from JSON and could in theory contain a __proto__ key. It is not clear that this is even exploitable to manipulate the any behavior of exposeGlobals, let alone the global object prototype.

Nevertheless, out of an abundance of caution, this forbids passing __proto__ or constructor as shims.

Closes #245