Style Dictionary - Prototype Pollution in convertTokenData utility function
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.tokensproperty with thesd.tokenMapproperty 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.tokensproperty with thesd.tokenMapproperty.
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.')
}
Betroffene Software
Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.
| Plattform | Paket | Anfällige Versionen | Behoben in |
|---|---|---|---|
| npm-Paket | style-dictionary | >= 4.3.0, < 5.4.4 | 5.4.4 |
Verweise
- https://github.com/style-dictionary/style-dictionary/security/advisories/GHSA-vj5c-m527-mpff
- https://nvd.nist.gov/vuln/detail/CVE-2026-54639
- https://github.com/style-dictionary/style-dictionary/pull/1702
- https://github.com/style-dictionary/style-dictionary/commit/209085d9782cfc0783c4d983f3f1bb2c515954ec
- https://github.com/style-dictionary/style-dictionary/commit/23b5e8dda143441f0d6b8e2b4222e2da98058bc5
- https://github.com/style-dictionary/style-dictionary
- https://github.com/style-dictionary/style-dictionary/releases/tag/v5.4.4
- CVSS-Vektor
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H- Schwäche (CWE)
CWE-1321- Plattform
- npm
- Paket
style-dictionary- Veröffentlicht
- 28.07.2026
- Aktualisiert
- 11.10.2026 10:22
Quellen und Lizenzen
OSV / GitHub Advisory Database - GHSA-vj5c-m527-mpff - CC BY 4.0
Schwachstellenhistorie: style-dictionary
Alle veröffentlichten Schwachstellen dieses Pakets (npm-Paket), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.
Dies ist die einzige bekannte Schwachstelle dieses Pakets.
Erkennen Sie Schwachstellen in Ihrer Anwendung
Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.