Skip to content

Commit 30194c7

Browse files
committed
fix(security): further prevent binding of Function calls which may evade detection
1 parent eac48fe commit 30194c7

11 files changed

+24
-5
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGES for jsonpath-plus
22

3+
## 10.0.4
4+
5+
- fix(security): further prevent binding of Function calls which may evade detection
6+
37
## 10.0.3
48

59
- fix(security): prevent binding of Function calls which may evade detection

dist/index-browser-esm.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,6 +1325,9 @@ const SafeEval = {
13251325
if (func === Function) {
13261326
throw new Error('Function constructor is disabled');
13271327
}
1328+
if (func.toString() === 'function () { [native code] }') {
1329+
throw new Error('Native functions are disabled');
1330+
}
13281331
return func(...args);
13291332
},
13301333
evalAssignmentExpression(ast, subs) {

dist/index-browser-esm.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index-browser-esm.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index-browser-umd.cjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,6 +1331,9 @@
13311331
if (func === Function) {
13321332
throw new Error('Function constructor is disabled');
13331333
}
1334+
if (func.toString() === 'function () { [native code] }') {
1335+
throw new Error('Native functions are disabled');
1336+
}
13341337
return func(...args);
13351338
},
13361339
evalAssignmentExpression(ast, subs) {

dist/index-browser-umd.min.cjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/index-browser-umd.min.cjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index-node-cjs.cjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,6 +1326,9 @@ const SafeEval = {
13261326
if (func === Function) {
13271327
throw new Error('Function constructor is disabled');
13281328
}
1329+
if (func.toString() === 'function () { [native code] }') {
1330+
throw new Error('Native functions are disabled');
1331+
}
13291332
return func(...args);
13301333
},
13311334
evalAssignmentExpression(ast, subs) {

dist/index-node-esm.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,6 +1324,9 @@ const SafeEval = {
13241324
if (func === Function) {
13251325
throw new Error('Function constructor is disabled');
13261326
}
1327+
if (func.toString() === 'function () { [native code] }') {
1328+
throw new Error('Native functions are disabled');
1329+
}
13271330
return func(...args);
13281331
},
13291332
evalAssignmentExpression(ast, subs) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"author": "Stefan Goessner",
33
"name": "jsonpath-plus",
4-
"version": "10.0.3",
4+
"version": "10.0.4",
55
"type": "module",
66
"bin": {
77
"jsonpath": "./bin/jsonpath-cli.js",

0 commit comments

Comments
 (0)