cbor-x 1.5.6 → 1.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/decode.js +5 -1
- package/dist/decode-no-eval.cjs +5 -1
- package/dist/decode-no-eval.cjs.map +1 -1
- package/dist/index-no-eval.cjs +5 -1
- package/dist/index-no-eval.cjs.map +1 -1
- package/dist/index-no-eval.min.js +1 -1
- package/dist/index-no-eval.min.js.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/node.cjs +5 -1
- package/dist/node.cjs.map +1 -1
- package/dist/test.js +2399 -38
- package/dist/test.js.map +1 -1
- package/index.d.ts +6 -0
- package/package.json +2 -2
package/dist/node.cjs
CHANGED
|
@@ -501,7 +501,11 @@ function createStructureReader(structure) {
|
|
|
501
501
|
}
|
|
502
502
|
|
|
503
503
|
function safeKey(key) {
|
|
504
|
-
|
|
504
|
+
// protect against prototype pollution
|
|
505
|
+
if (typeof key === 'string') return key === '__proto__' ? '__proto_' : key
|
|
506
|
+
if (typeof key !== 'object') return key.toString()
|
|
507
|
+
// protect against expensive (DoS) string conversions
|
|
508
|
+
throw new Error('Invalid property name type ' + typeof key);
|
|
505
509
|
}
|
|
506
510
|
|
|
507
511
|
let readFixedString = readStringJS;
|