diff --git a/backend/terminal.ts b/backend/terminal.ts index 2a31f17..f6e06cc 100644 --- a/backend/terminal.ts +++ b/backend/terminal.ts @@ -219,11 +219,14 @@ export class MainTerminal extends InteractiveTerminal { // Check if the command is allowed const cmdParts = input.split(" "); const executable = cmdParts[0].trim(); + const knownOperators = ["&&", "||", "&", ";"]; log.debug("console", "Executable: " + executable); log.debug("console", "Executable length: " + executable.length); if (!allowedCommandList.includes(executable)) { throw new Error("Command not allowed."); + } else if (knownOperators.some(operator => input.includes(operator))) { + throw new Error("Control operators are not allowed."); } super.write(input); }