CVE-2022-37621
Description
Prototype pollution in browserify-shim's resolveShims function allows attackers to pollute Object.prototype via crafted fullPath input.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Prototype pollution in browserify-shim's resolveShims function allows attackers to pollute Object.prototype via crafted fullPath input.
Vulnerability
Description CVE-2022-37621 is a prototype pollution vulnerability in the resolveShims function of the resolve-shims.js file in the browserify-shim package (version 3.8.15). The flaw occurs when the fullPath variable is used to set properties on an object without proper sanitization, allowing an attacker to inject properties into the global Object.prototype [1][2]. This is a classic prototype pollution pattern where user-controlled input can modify the prototype chain of all objects.
Exploitation
An attacker can exploit this vulnerability by crafting a malicious fullPath value that contains special keys like __proto__ or constructor.prototype. When the resolveShims function processes this input, it pollutes the prototype of all objects in the application [3][4]. The attack requires the ability to influence the fullPath variable, which may be achieved through a malicious package.json or shim configuration file. No authentication is needed if the attacker can supply such a file to the build process.
Impact
Successful exploitation allows an attacker to pollute Object.prototype, leading to potential property injection across the entire application. This can result in denial of service, unexpected behavior, or in some cases, arbitrary code execution if the polluted properties are used in security-sensitive operations [3]. The impact is amplified in server-side or build-time contexts where the polluted prototype affects all subsequent object operations.
Mitigation
The vulnerability has been patched in a commit to the browserify-shim repository [2]. Users should update to a version that includes the fix (e.g., after commit 97855e6). There is no evidence that this CVE is listed in CISA's Known Exploited Vulnerabilities catalog. As a workaround, users can avoid processing untrusted shim configurations or sanitize input before passing it to resolveShims.
- GitHub - thlorenz/browserify-shim: 📩 Makes CommonJS incompatible files browserifyable.
- resolve-shims: prevent prototype manipulation (#246) · thlorenz/browserify-shim@97855e6
- NVD - CVE-2022-37621
- browserify-shim/lib/resolve-shims.js at 464b32bbe142664cd9796059798f6c738ea3de8f · thlorenz/browserify-shim
AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
browserify-shimnpm | < 3.8.16 | 3.8.16 |
Affected products
2- thlorenz/browserify-shimdescription
Patches
197855e622b6dresolve-shims: prevent prototype manipulation (#246)
1 file changed · +5 −0
lib/resolve-shims.js+5 −0 modified@@ -123,6 +123,11 @@ function separateExposeGlobals(shims) { , exposeGlobals = {}; Object.keys(shims).forEach(function (k) { + // https://github.com/thlorenz/browserify-shim/issues/245 + if (k === '__proto__' || k === 'constructor') { + return; + } + var val = shims[k] , exp = val && val.exports;
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
7- github.com/advisories/GHSA-r737-347m-wqc7ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-37621ghsaADVISORY
- github.com/thlorenz/browserify-shim/blob/464b32bbe142664cd9796059798f6c738ea3de8f/lib/resolve-shims.jsghsaWEB
- github.com/thlorenz/browserify-shim/blob/464b32bbe142664cd9796059798f6c738ea3de8f/lib/resolve-shims.jsghsaWEB
- github.com/thlorenz/browserify-shim/commit/97855e622b6dcd117c77e6583701962ff45e7338ghsaWEB
- github.com/thlorenz/browserify-shim/issues/247ghsaWEB
- github.com/thlorenz/browserify-shim/pull/246ghsaWEB
News mentions
0No linked articles in our index yet.