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

MODERATE
Advisory Identifier: GHSA-hjwq-mjwj-4x6c
CWE-1321
Published
Advisory Summary

CVE-2024-52810 is a MODERATE @intlify/shared prototype pollution vulnerability vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting @intlify/shared libraries in the npm ecosystem. The issue involves @intlify/shared prototype pollution vulnerability. Remediation is available by upgrading affected packages to version 9.14.2, 10.0.5.

CVE-2024-52810 at a Glance

CVE Identifier CVE-2024-52810
GHSA Identifier GHSA-hjwq-mjwj-4x6c
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Affected Product @intlify/shared
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2024-52810

To remediate this vulnerability, upgrade all affected @intlify/shared dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@intlify/shared fixed: 9.14.2
npm install @intlify/shared@9.14.2
@intlify/vue-i18n-core fixed: 9.14.2
npm install @intlify/vue-i18n-core@9.14.2
vue-i18n fixed: 9.14.2
npm install vue-i18n@9.14.2
petite-vue-i18n fixed: 10.0.5
npm install petite-vue-i18n@10.0.5
@intlify/shared fixed: 10.0.5
npm install @intlify/shared@10.0.5
@intlify/vue-i18n-core fixed: 10.0.5
npm install @intlify/vue-i18n-core@10.0.5
vue-i18n fixed: 10.0.5
npm install vue-i18n@10.0.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @intlify/shared

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2024-52810, inspect your project dependencies using npm:

npm ls @intlify/shared

Analyze the terminal output to locate any version of @intlify/shared in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 9.14.2), your application is affected.

Note: The npm ls @intlify/shared command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. In @intlify/shared, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

**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:** ```bash // 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} ``` ```js (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](https://research.securitum.com/prototype-pollution-rce-kibana-cve-2019-7609/) - An example of how prototype pollution can lead to command code injection. [OWASP Prototype Pollution Prevention Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Prototype_Pollution_Prevention_Cheat_Sheet.html) - Best practices for preventing prototype pollution. [PortSwigger Guide on Preventing Prototype Pollution](https://portswigger.net/web-security/prototype-pollution/preventing) - A detailed guide to securing your applications against prototype pollution.

CVE-2024-52810 Affected @intlify/shared Versions

7 component(s)
Fixed Versions:
9.14.210.0.5
Product / Package Ecosystem Affected Versions Fixed Version
@intlify/shared
npm
≥ 9.7.0
< 9.14.2
9.14.2
@intlify/vue-i18n-core
npm
≥ 9.7.0
< 9.14.2
9.14.2
vue-i18n
npm
≥ 9.7.0
< 9.14.2
9.14.2
petite-vue-i18n
npm
≥ 10.0.0
< 10.0.5
10.0.5
@intlify/shared
npm
≥ 10.0.0
< 10.0.5
10.0.5
@intlify/vue-i18n-core
npm
≥ 10.0.0
< 10.0.5
10.0.5
vue-i18n
npm
≥ 10.0.0
< 10.0.5
10.0.5

References

Frequently Asked Questions

What is CVE-2024-52810?
CVE-2024-52810 is a security vulnerability in @intlify/shared involving @intlify/shared Prototype Pollution vulnerability under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution').
Which @intlify/shared versions are affected?
Affected versions include releases prior to 9.14.2, 10.0.5 across affected packages: @intlify/shared, @intlify/vue-i18n-core, vue-i18n, petite-vue-i18n.
What version fixes CVE-2024-52810?
Upgrading to 9.14.2, 10.0.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @intlify/shared affected?
Yes, @intlify/shared is affected in releases prior to 9.14.2, 10.0.5. Upgrade your dependency to 9.14.2, 10.0.5 or later.
Is @intlify/vue-i18n-core affected?
Yes, @intlify/vue-i18n-core is affected in releases prior to 9.14.2, 10.0.5. Upgrade your dependency to 9.14.2, 10.0.5 or later.
What CWE is associated with CVE-2024-52810?
CVE-2024-52810 is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') (The product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype.).
How can I check npm dependencies for CVE-2024-52810?
Run the dependency tree command: 'npm ls @intlify/shared'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hjwq-mjwj-4x6c",
  "modified" : "2024-12-02T17:26:47Z",
  "published" : "2024-12-02T17:26:47Z",
  "aliases" : [ "CVE-2024-52810" ],
  "summary" : "@intlify/shared Prototype Pollution vulnerability",
  "details" : "**Vulnerability type: Prototype Pollution**\n\n**Affected Package:**\n\nProduct: @intlify/shared\nVersion: 10.0.4\n\n\n**Vulnerability Location(s):**\n\n`node_modules/@intlify/shared/dist/shared.cjs:232:26`\n\n\n**Description:**\n\nThe 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.\n\nMoreover, 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.\n\n**PoC:**\n\n```bash\n// install the package with the latest version\n~$ npm install @intlify/shared@10.0.4\n// run the script mentioned below \n~$ node poc.js\n//The expected output (if the code still vulnerable) is below. \n// Note that the output may slightly differs from function to another.\nBefore Attack:  {}\nAfter Attack:  {\"pollutedKey\":123}\n```\n\n\n```js\n(async () => {\nconst lib = await import('@intlify/shared');\nvar someObj = {}\nconsole.log(\"Before Attack: \", JSON.stringify({}.__proto__));\ntry {\n// for multiple functions, uncomment only one for each execution.\nlib.deepCopy (JSON.parse('{\"__proto__\":{\"pollutedKey\":123}}'), someObj)\n} catch (e) { }\nconsole.log(\"After Attack: \", JSON.stringify({}.__proto__));\ndelete Object.prototype.pollutedKey;\n})();\n```\n\n**References**\n\n[Prototype Pollution Leading to Remote Code Execution](https://research.securitum.com/prototype-pollution-rce-kibana-cve-2019-7609/) - An example of how prototype pollution can lead to command code injection.\n\n[OWASP Prototype Pollution Prevention Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Prototype_Pollution_Prevention_Cheat_Sheet.html) - Best practices for preventing prototype pollution.\n\n[PortSwigger Guide on Preventing Prototype Pollution](https://portswigger.net/web-security/prototype-pollution/preventing) - A detailed guide to securing your applications against prototype pollution.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@intlify/shared"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "9.7.0"
      }, {
        "fixed" : "9.14.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@intlify/vue-i18n-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "9.7.0"
      }, {
        "fixed" : "9.14.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "vue-i18n"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "9.7.0"
      }, {
        "fixed" : "9.14.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "petite-vue-i18n"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.0.0"
      }, {
        "fixed" : "10.0.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@intlify/shared"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.0.0"
      }, {
        "fixed" : "10.0.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@intlify/vue-i18n-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.0.0"
      }, {
        "fixed" : "10.0.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "vue-i18n"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.0.0"
      }, {
        "fixed" : "10.0.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/intlify/vue-i18n/security/advisories/GHSA-hjwq-mjwj-4x6c"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-52810"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/intlify/vue-i18n/commit/9f20909ef8c9232a1072d7818e12ed6d6451024d"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/intlify/vue-i18n"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1321" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-12-02T17:26:47Z",
    "nvd_published_at" : "2024-11-29T19:15:09Z"
  }
}