mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-21 04:41:16 -05:00
Short circuit allow-list check when it includes command chaining characters
This commit is contained in:
@@ -134,7 +134,18 @@ export class Cline {
|
||||
}
|
||||
|
||||
protected isAllowedCommand(command?: string): boolean {
|
||||
if (!command) return false;
|
||||
if (!command) {
|
||||
return false;
|
||||
}
|
||||
// Check for command chaining characters
|
||||
if (command.includes('&&') ||
|
||||
command.includes(';') ||
|
||||
command.includes('||') ||
|
||||
command.includes('|') ||
|
||||
command.includes('$(') ||
|
||||
command.includes('`')) {
|
||||
return false;
|
||||
}
|
||||
const trimmedCommand = command.trim().toLowerCase();
|
||||
return ALLOWED_AUTO_EXECUTE_COMMANDS.some(prefix =>
|
||||
trimmedCommand.startsWith(prefix.toLowerCase())
|
||||
|
||||
Reference in New Issue
Block a user