From 04486040c3fb55864973f69a41e46232e992dbc7 Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 16 Mar 2022 10:52:51 +0530 Subject: [PATCH] detect misconfiguration and abort --- www/common/sframe-boot2.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/www/common/sframe-boot2.js b/www/common/sframe-boot2.js index 2870be392..323efaef6 100644 --- a/www/common/sframe-boot2.js +++ b/www/common/sframe-boot2.js @@ -43,5 +43,14 @@ define([ throw e; }; + var caughtEval; + try { eval('true'); } catch (err) { caughtEval = true; } + + if (!/^\/(sheet|doc|presentation)/.test(window.location.pathname) && !caughtEval) { + return void setTimeout(function () { + alert("aborting because eval should not be permitted."); + }); + } + require([document.querySelector('script[data-bootload]').getAttribute('data-bootload')]); });