Skip to content

Commit 763ada0

Browse files
committed
fix(security): prevent call/apply invocation of Function
1 parent 98a6b22 commit 763ada0

12 files changed

+28
-6
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.6
4+
5+
- fix(security): prevent `call`/`apply` invocation of `Function`
6+
37
## 10.0.5
48

59
- fix: remove overly aggressive disabling of native functions but

badges/coverage-badge.svg

Lines changed: 1 addition & 1 deletion
Loading

dist/index-browser-esm.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,6 +1299,9 @@ const SafeEval = {
12991299
if (obj === Function && prop === 'bind') {
13001300
throw new Error('Function.prototype.bind is disabled');
13011301
}
1302+
if (obj === Function && (prop === 'call' || prop === 'apply')) {
1303+
throw new Error('Function.prototype.call and ' + 'Function.prototype.apply are disabled');
1304+
}
13021305
if (result === Function) {
13031306
return result; // Don't bind so can identify and throw later
13041307
}

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
@@ -1305,6 +1305,9 @@
13051305
if (obj === Function && prop === 'bind') {
13061306
throw new Error('Function.prototype.bind is disabled');
13071307
}
1308+
if (obj === Function && (prop === 'call' || prop === 'apply')) {
1309+
throw new Error('Function.prototype.call and ' + 'Function.prototype.apply are disabled');
1310+
}
13081311
if (result === Function) {
13091312
return result; // Don't bind so can identify and throw later
13101313
}

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
@@ -1300,6 +1300,9 @@ const SafeEval = {
13001300
if (obj === Function && prop === 'bind') {
13011301
throw new Error('Function.prototype.bind is disabled');
13021302
}
1303+
if (obj === Function && (prop === 'call' || prop === 'apply')) {
1304+
throw new Error('Function.prototype.call and ' + 'Function.prototype.apply are disabled');
1305+
}
13031306
if (result === Function) {
13041307
return result; // Don't bind so can identify and throw later
13051308
}

dist/index-node-esm.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,6 +1298,9 @@ const SafeEval = {
12981298
if (obj === Function && prop === 'bind') {
12991299
throw new Error('Function.prototype.bind is disabled');
13001300
}
1301+
if (obj === Function && (prop === 'call' || prop === 'apply')) {
1302+
throw new Error('Function.prototype.call and ' + 'Function.prototype.apply are disabled');
1303+
}
13011304
if (result === Function) {
13021305
return result; // Don't bind so can identify and throw later
13031306
}

0 commit comments

Comments
 (0)