summaryrefslogtreecommitdiff
path: root/core/02_error.js
diff options
context:
space:
mode:
authorColin Ihrig <cjihrig@gmail.com>2022-09-07 09:11:16 -0400
committerGitHub <noreply@github.com>2022-09-07 09:11:16 -0400
commit3b1204eb2d9c5cdf21bb92f7c8923869477f0969 (patch)
treeec8ccce739841defa84764253e172ee2d3db5ae1 /core/02_error.js
parent027d4d433dce32a3b715184b54e7fe6403dedec2 (diff)
fix(core): make errors more resistant to tampering (#15789)
This commit makes error objects more resistant to prototype tampering. This bug was found when updating the deno_std Node compatibility layer to Node 18. The Node test 'parallel/test-assert-fail.js' was breaking std's assertion library. Refs: https://github.com/denoland/deno_std/pull/2585
Diffstat (limited to 'core/02_error.js')
-rw-r--r--core/02_error.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/02_error.js b/core/02_error.js
index edb9c4843..d8e823bb2 100644
--- a/core/02_error.js
+++ b/core/02_error.js
@@ -127,7 +127,7 @@
let callSiteEvals = ArrayPrototypeMap(callSites, evaluateCallSite);
callSiteEvals = ArrayPrototypeMap(callSiteEvals, sourceMapCallSiteEval);
ObjectDefineProperties(error, {
- __callSiteEvals: { value: [], configurable: true },
+ __callSiteEvals: { __proto__: null, value: [], configurable: true },
});
const formattedCallSites = [];
for (const cse of callSiteEvals) {