Secure drop-in replacement for the global `JSON` object
Secure drop-in replacement for the global JSON object with prototype pollution protection
Follow @eldorplus and @httpiejs for updates!
---
@httpie/json package is a drop-in replacement for the global JSON object. It protects JSON parsing against protoype pollution attacks.```
npm i @httpie/json
is pretty straightforward. Use it the same way as you would use the JSON object:`js
const JSON = require('@httpie/json')const user = JSON.parse('{"name":"Supercharge"}')
// { name: 'Supercharge' }
const user = JSON.parse('{"name":"Supercharge", "__proto__": { "x": 1 }, "constructor": {"prototype": {"bar": "baz"} } }')
// { name: 'Supercharge' }
const json = JSON.stringify({ name: 'Supercharge' })
// '{"name":"Supercharge"}'
`
Contributing
Do you miss a function? We very much appreciate your contribution! Please send in a pull request ๐1. Create a fork
2. Create your feature branch:
git checkout -b my-feature
3. Commit your changes: git commit -am 'Add some feature'
4. Push to the branch: git push origin my-new-feature`---
> httpiejs.com ·
> GitHub @httpie ·
> Twitter @httpiejs