Where
-Infinity
0
Severity
6.3
AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:L

Style Dictionary 4.3.0 before 5.7.1 contains a prototype pollution vulnerability in convertTokenData that allows attackers to modify Object.prototype by supplying nested token keys. Attackers can submit a token key descending through an existing leaf token, such as a.proto.polluted, to pollute global prototypes, altering application logic or causing denial of service.

First published (updated )
Severity
6.3
AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N

Style Dictionary 4.3.0 before 5.7.1 contains a prototype pollution vulnerability in convertTokenData that allows attackers to modify Object.prototype by supplying nested token keys. Attackers can submit a token key descending through an existing leaf token, such as a.proto.polluted, to pollute global prototypes, altering application logic or causing denial of service.

First published (updated )
Severity
8.8
AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

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.

js 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.') }

1 / 2
Source: GitHub
First published (updated )

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203