From ab169afa370680deab76bafe52c6097ccf8e7ee6 Mon Sep 17 00:00:00 2001 From: Konloch Date: Sun, 13 Feb 2022 15:29:51 -0600 Subject: [PATCH] Sandbox Disabled - Fixes #386 #361 #332 In general this seems to be causing more problems than it has solved, in the future I will attempt a more secure sandbox --- .../club/bytecodeviewer/util/SecurityMan.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/SecurityMan.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/SecurityMan.java index 88f0e3d7..9e9b9283 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/SecurityMan.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/SecurityMan.java @@ -45,6 +45,9 @@ import the.bytecode.club.bytecodeviewer.resources.ExternalResources; public class SecurityMan extends SecurityManager { + private static final boolean disableExecSandbox = true; + private static final boolean disableDiskWriteSandbox = true; + private final AtomicInteger silentExec = new AtomicInteger(1); private boolean printing = false; private boolean printingPackage = false; @@ -76,6 +79,10 @@ public class SecurityMan extends SecurityManager @Override public void checkExec(String cmd) { + //This was disabled on 02-13-2022, at some point in the future I will fix the compatibility issues and re-enable it. + if(disableExecSandbox) + return; + //incoming command must contain the following or it will be automatically denied String[] execWhitelist = { @@ -316,6 +323,10 @@ public class SecurityMan extends SecurityManager public void checkWrite(String file) { if(printing) System.out.println("Writing: " + file); + + //This was disabled on 02-13-2022, at some point in the future I will fix the compatibility issues and re-enable it. + if(disableDiskWriteSandbox) + return; try {