7.2high
@nevware21/ts-utils: Prototype Pollution in objDeepCopy/objCopyProps via for...in without hasOwnProperty
- Severity
- 7.2high CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.36% (higher than 31% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-x7j8-49r8-mr43
Description
@nevware21/ts-utils is a comprehensive TypeScript/JavaScript utility library. Prior to version 0.14.0, the _copyProps function in lib/src/object/copy.ts uses for...in to iterate over source object properties without an Object.hasOwnProperty check, and does not filter dangerous keys (__proto__, constructor, prototype). This allows an attacker to pollute the prototype chain of all objects in the application. Version 0.14.0 patches the issue.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| nevware21 ts-utils | < 0.14.0 | CVE List |
| @nevware21/ts-utils (npm) | before 0.14.0 | GitHub Advisory Database |
All scores
| GitHub_M | 7.2high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U |
| GitHub | high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U |
Classification
SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total.
What each source says
CVE List
@nevware21/ts-utils is a comprehensive TypeScript/JavaScript utility library. Prior to version 0.14.0, the _copyProps function in lib/src/object/copy.ts uses for...in to iterate over source object properties without an Object.hasOwnProperty check, and does not filter dangerous keys (__proto__, constructor, prototype). This allows an attacker to pollute the prototype chain of all objects in the application. Version 0.14.0 patches the issue.
GitHub Advisory Database
Summary
The _copyProps function in lib/src/object/copy.ts uses for...in to iterate over source object properties without an Object.hasOwnProperty check, and does not filter dangerous keys (proto, constructor, prototype). This allows an attacker to pollute the prototype chain of all objects in the application.
Details
In _copyProps() (copy.ts lines 186-191), the code iterates all enumerable properties including inherited ones and dangerous keys like proto. Any object with a proto key (e.g., from untrusted JSON input) will overwrite the target's prototype.
PoC
const malicious = JSON.parse('{"__proto__": {"polluted": true}}');
objDeepCopy(malicious);
console.log({}.polluted); // true
Suggested Fix
Add objHasOwnProperty check and filter proto, constructor, prototype keys.
NVD (es)
@nevware21/ts-utils es una completa biblioteca de utilidades de TypeScript/JavaScript. Antes de la versión 0.14.0, la función _copyProps en lib/src/object/copy.ts utiliza for...in para iterar sobre las propiedades del objeto de origen sin una comprobación de Object.hasOwnProperty, y no filtra claves peligrosas (__proto__, constructor, prototype). Esto permite a un atacante contaminar la cadena de prototipos de todos los objetos en la aplicación. La versión 0.14.0 soluciona el problema.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-46681 changed 2026-07-21 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-x7j8-49r8-mr43 changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-46681 changed 2026-10-24 | Public domain |