Skip to content
This repository was archived by the owner on Feb 17, 2022. It is now read-only.
This repository was archived by the owner on Feb 17, 2022. It is now read-only.

Prototype Pollution #11

@larrycameron80

Description

@larrycameron80

Prototype Pollution
Vulnerable module: deep-extend
Introduced through: command-line-args@2.1.6
Detailed paths
Introduced through: firstbloodtoken@Firstbloodio/token#ae71053e0656b0ceba7e229e1d67c09f271191dc › command-line-args@2.1.6 › command-line-usage@2.0.5 › column-layout@2.1.4 › deep-extend@0.4.2
Overview
deep-extend is a library for Recursive object extending.

Affected versions of this package are vulnerable to Prototype Pollution. Utilities function in all the listed modules can be tricked into modifying the prototype of "Object" when the attacker control part of the structure passed to these function. This can let an attacker add or modify existing property that will exist on all object.

PoC by HoLyVieR
var merge = require('deep-extend');
var malicious_payload = '{"proto":{"oops":"It works !"}}';

var a = {};
console.log("Before : " + a.oops);
merge({}, JSON.parse(malicious_payload));
console.log("After : " + a.oops);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions