v5.0.0
5.0.0 (2021-10-31)
Bug Fixes
-
Fix prototype pollution (#51)
- The original, non-mutated objects are now returned if any of the keys
__proto__,constructororprototypeare used in a json pointer.
// returns the unmodified input {} jsonpointer.set({}, '/foo/__proto__/boo', 'polluted')
- When passing non-string arrays to a
.setoperation, an error is thrown:
// throws `new Error('Invalid JSON pointer. Must be of type string or number.')` jsonpointer.set({}, [['__proto__'], ['__proto__'], 'boo'], 'polluted')
- The original, non-mutated objects are now returned if any of the keys