CVE-2026-12644: ts-deepmerge Denial of Service via Prototype Method Injection
ts-deepmerge is a JavaScript utility library for merging nested objects. Versions before 8.0.0 have a critical flaw: when merging objects that contain properties named after built-in JavaScript methods like `toString` or `valueOf` with non-function values, the library corrupts the resulting object. Any attempt to use the merged object in a string context—such as logging, concatenation, or template operations—triggers a TypeError crash. This means an application using vulnerable versions of ts-deepmerge can be made to crash by an attacker providing specially crafted JSON or configuration objects for merging.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 5.3 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- Weaknesses (CWE)
- CWE-248
- Affected products
- 0 configuration(s)
- Published / Modified
- 2026-06-19 / 2026-06-23
NVD description (verbatim)
Versions of the package ts-deepmerge before 8.0.0 are vulnerable to Uncaught Exception due to the improper handling of built-in Object.prototype methods (such as toString, valueOf). When user-controlled input contains these keys with non-function values, the resulting merged object becomes broken — any string context operation throws a TypeError, crashing the application.
4 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability stems from improper handling of Object.prototype reserved method names during the deep merge operation. When ts-deepmerge encounters user-controlled input with keys matching built-in object methods (toString, valueOf, etc.) assigned non-function values, these properties overwrite the prototype's method implementations on the merged object. The CVSS 3.1 vector (5.3 MEDIUM, AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L) reflects a network-accessible denial-of-service condition with no authentication required, but no confidentiality or integrity impact. The weakness is classified under CWE-248 (Uncaught Exception).
Business impact
Applications using ts-deepmerge as a dependency face availability risk. Any service that merges untrusted JSON (from API requests, uploaded files, webhooks, or third-party integrations) with this library version becomes susceptible to crash attacks. For data processing pipelines, configuration management systems, or multi-tenant SaaS platforms that merge user-provided settings, a single malicious payload can trigger application downtime. The impact is limited to denial of service, but recovery requires restarting the affected process.
Affected systems
The vulnerability affects all versions of the npm package ts-deepmerge before version 8.0.0. Any project directly importing ts-deepmerge or indirectly relying on it as a transitive dependency could be affected. JavaScript/Node.js applications across all operating systems are in scope. Organizations should audit their dependency trees using tools like `npm ls ts-deepmerge` or equivalent package audits to identify affected installations.
Exploitability
Exploitation requires no authentication, no special privileges, and no user interaction. An attacker simply needs to supply a crafted object with a prototype method name (e.g., `{"toString": 123}`) to an API endpoint or configuration interface that uses ts-deepmerge to merge the input. The low complexity and network accessibility make this straightforward to weaponize at scale. However, the attacker must have a pathway to provide input to the merge operation—not all applications expose this.
Remediation
Upgrade ts-deepmerge to version 8.0.0 or later. This patch version resolves the improper handling of Object.prototype methods. Organizations should verify the fix is available through the official npm registry and test the upgraded package in a development environment before rolling out to production. For applications unable to upgrade immediately, consider input validation to reject objects with keys matching reserved method names, though this is a temporary mitigation and not a substitute for patching.
Patch guidance
Update the dependency in package.json to ts-deepmerge@^8.0.0 (or specify 8.0.0 or any newer version). Run `npm install` or equivalent to pull the patched version. Ensure your CI/CD pipeline validates that the installed version meets the minimum requirement. Test any code paths that perform deep merges with untrusted or external data. If using npm, run `npm audit` post-update to confirm the CVE is no longer flagged.
Detection guidance
Monitor runtime errors for TypeErrors related to toString or valueOf operations in merged objects. Application logs showing crashes during JSON merge or configuration loading are indicators of exploitation attempts. Additionally, use dependency scanning tools (npm audit, OWASP Dependency-Check, Snyk) to identify ts-deepmerge versions below 8.0.0 in your codebase. Network-level detection is difficult since the attack payload is legitimate-looking JSON; focus on application behavior and supply-chain visibility.
Why prioritize this
Although classified as MEDIUM severity, ts-deepmerge is a widely-used utility in the Node.js ecosystem. The attack surface depends on how and where your applications perform deep merges. If your services accept untrusted JSON for configuration, user profile merging, or aggregated data processing, this should be prioritized for immediate patching. If ts-deepmerge usage is limited to internal, trusted data only, the risk is lower. Assess your exposure path and prioritize accordingly.
Risk score, explained
CVSS 5.3 (MEDIUM) reflects a denial-of-service vulnerability with network access, low complexity, no authentication, and limited to availability impact. The score does not account for the ubiquity of ts-deepmerge in the ecosystem or organizational dependency on affected applications. Internal risk scoring should consider the criticality of services using the library and the likelihood of untrusted input reaching the merge function.
Frequently asked questions
Can this vulnerability result in data loss or data exfiltration?
No. The vulnerability causes application crashes (denial of service) but does not expose, modify, or destroy data. Once the application restarts, normal operation resumes. There is no confidentiality or integrity impact.
How do I check if my project uses ts-deepmerge?
Use `npm ls ts-deepmerge` in your project directory to display the installed version and any dependents. If the output shows any version below 8.0.0, you are affected. You can also search package.json files or use automated SBOM tools to identify the package across your portfolio.
What if I cannot upgrade immediately?
As a temporary measure, implement input validation to reject or sanitize objects with keys matching Object.prototype method names (toString, valueOf, hasOwnProperty, etc.) before passing them to the merge function. However, this is not a reliable long-term solution and you should plan an upgrade immediately.
Does this affect TypeScript projects differently than JavaScript?
TypeScript is compiled to JavaScript at runtime, so ts-deepmerge behavior is identical. The vulnerability affects both TypeScript and JavaScript projects using the package. TypeScript's type system does not prevent the runtime issue.
This analysis is based on the CVE record as of the modification date (2026-06-23) and the CVSS 3.1 scoring vector provided. Actual exploitation impact may vary depending on application architecture, input validation, and network exposure. Always verify patch availability and compatibility with your specific version of ts-deepmerge through the official npm registry and the maintainer's release notes before applying updates. This advisory does not constitute legal or compliance advice; consult your organization's security and compliance teams for internal policies. Source: NVD (public-domain), retrieved 2026-07-27. Analysis generated by SEC.co (claude-haiku-4-5).
Weaknesses (CWE)
Related vulnerabilities
- CVE-2026-45554MEDIUMNiceGUI Static Asset Route Log Flooding Vulnerability
- CVE-2026-45676MEDIUMOpenTelemetry eBPF Instrumentation ELF Parser Denial of Service
- CVE-2026-46411MEDIUMFlashMQ Authentication DoS via Write Buffer Overflow
- CVE-2026-45685HIGHOpenTelemetry eBPF Instrumentation MongoDB Parser DoS (v0.1.0–0.8.x)
- CVE-2026-46545HIGHNimiq State Sync Denial-of-Service Vulnerability (CVSS 7.5)
- CVE-2016-20064MEDIUMWP Vault 0.8.6.6 Arbitrary File Read via Directory Traversal
- CVE-2016-20067MEDIUMWordPress CP Polls CSRF Vulnerability
- CVE-2016-20070MEDIUMPrivilege Escalation & Stored XSS in WordPress Booking Calendar Contact Form 1.0.23