GHSA-VJ5C-M527-MPFF

Vulnerability from github – Published: 2026-07-28 22:23 – Updated: 2026-07-28 22:23
VLAI
Summary
Style Dictionary - Prototype Pollution in convertTokenData utility function
Details

Impact

Prototype pollution. A malicious user can create a token array [{ key: '{__proto__.foo}', value: 'malicious' }], when processed by convertTokenData() utility function, it will pollute the Object.prototype globally where {}.foo will equal { key: '{__proto__.foo}', value: 'malicious' }.

This has been confirmed with a test/reproduction.

You are impacted when: - direct usage of convertTokenData(tokens, { output: 'object' }); - indirect usage, via using Expand API https://styledictionary.com/reference/config/#expand. If your expand config deems it necessary to run expand (this means, if NOT: 1) set to false, 2) all subprops set to false, or 3) undefined), then we sync the sd.tokens property with the sd.tokenMap property by converting tokenData map back to object. - indirect usage via SD's transform lifecycle. Once your tokens are transformed, we also have to sync the sd.tokens property with the sd.tokenMap property.

Impact is high for this when style-dictionary is used as an integration in a NodeJS server application. Impact is moderate for when style-dictionary is used as an integration in a Web application. Impact is low for most common cases where the user of style-dictionary also maintains the tokens, and access is limited via read/write access to the repository/workflows where it is used.

Patches

A patch has been published: version 5.4.4. Any version within range >=4.3.0 <5.4.4 contains this vulnerability, see commit hash 209085d for when the vulnerability was added.

See PR with repro + fix https://github.com/style-dictionary/style-dictionary/pull/1702

Workarounds

A workaround is to sanitize your token data first. Whether using DTCG format or old Style Dictionary format, you have to check the token data object recursively for any object keys that include __proto__.

You can do this with the StyleDictionary instance too, just ensure that expand has to be set to false to prevent the second method of this vulnerability from happening.

const sd = new StyleDictionary({ expand: false });

if (sd.allTokens.some(tok => tok.key.includes('__proto__')) {
  throw new Error('Found malicious token key, attempting to do prototype pollution.')
}
Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "style-dictionary"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "4.3.0"
            },
            {
              "fixed": "5.4.4"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-54639"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-1321"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-07-28T22:23:03Z",
    "nvd_published_at": "2026-06-24T01:16:25Z",
    "severity": "HIGH"
  },
  "details": "### Impact\nPrototype pollution.\nA malicious user can create a token array `[{ key: \u0027{__proto__.foo}\u0027, value: \u0027malicious\u0027 }]`, when processed by `convertTokenData()` utility function, it will pollute the Object.prototype globally where `{}.foo` will equal `{ key: \u0027{__proto__.foo}\u0027, value: \u0027malicious\u0027 }`.\n\nThis has been confirmed with a test/reproduction.\n\nYou are impacted when:\n- direct usage of `convertTokenData(tokens, { output: \u0027object\u0027 });`\n- indirect usage, via using Expand API https://styledictionary.com/reference/config/#expand. If your expand config deems it necessary to run expand (this means, if NOT:  1) set to false, 2) all subprops set to false, or 3) undefined), then we sync the `sd.tokens` property with the `sd.tokenMap` property by converting tokenData map back to object.\n- indirect usage via SD\u0027s transform lifecycle. Once your tokens are transformed, we also have to sync the `sd.tokens` property with the `sd.tokenMap` property.\n\nImpact is high for this when style-dictionary is used as an integration in a NodeJS server application.\nImpact is moderate for when style-dictionary is used as an integration in a Web application.\nImpact is low for most common cases where the user of style-dictionary also maintains the tokens, and access is limited via read/write access to the repository/workflows where it is used.\n\n### Patches\nA patch has been published: version `5.4.4`.\nAny version within range `\u003e=4.3.0 \u003c5.4.4` contains this vulnerability, see commit hash 209085d for when the vulnerability was added.\n\nSee PR with repro + fix https://github.com/style-dictionary/style-dictionary/pull/1702\n\n### Workarounds\nA workaround is to sanitize your token data first. Whether using DTCG format or old Style Dictionary format, you have to check the token data object recursively for any object keys that include `__proto__`.\n\nYou can do this with the StyleDictionary instance too, just ensure that expand has to be set to false to prevent the second method of this vulnerability from happening.\n\n```js\nconst sd = new StyleDictionary({ expand: false });\n\nif (sd.allTokens.some(tok =\u003e tok.key.includes(\u0027__proto__\u0027)) {\n  throw new Error(\u0027Found malicious token key, attempting to do prototype pollution.\u0027)\n}\n```",
  "id": "GHSA-vj5c-m527-mpff",
  "modified": "2026-07-28T22:23:03Z",
  "published": "2026-07-28T22:23:03Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/style-dictionary/style-dictionary/security/advisories/GHSA-vj5c-m527-mpff"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-54639"
    },
    {
      "type": "WEB",
      "url": "https://github.com/style-dictionary/style-dictionary/pull/1702"
    },
    {
      "type": "WEB",
      "url": "https://github.com/style-dictionary/style-dictionary/commit/209085d9782cfc0783c4d983f3f1bb2c515954ec"
    },
    {
      "type": "WEB",
      "url": "https://github.com/style-dictionary/style-dictionary/commit/23b5e8dda143441f0d6b8e2b4222e2da98058bc5"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/style-dictionary/style-dictionary"
    },
    {
      "type": "WEB",
      "url": "https://github.com/style-dictionary/style-dictionary/releases/tag/v5.4.4"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Style Dictionary - Prototype Pollution in convertTokenData utility function"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…

Loading…