Added warning to avoid command substitution in run_shell_command tool… (#9934)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
owenofbrien
2025-09-26 13:16:05 -05:00
committed by GitHub
parent 3d7cb3fb8a
commit e909993dd1
3 changed files with 25 additions and 3 deletions
@@ -145,6 +145,15 @@ describe('isCommandAllowed', () => {
expect(result.reason).toContain('Command substitution');
});
it('should block command substitution using `>(...)`', () => {
const result = isCommandAllowed(
'echo "Log message" > >(tee log.txt)',
config,
);
expect(result.allowed).toBe(false);
expect(result.reason).toContain('Command substitution');
});
it('should block command substitution using backticks', () => {
const result = isCommandAllowed('echo `rm -rf /`', config);
expect(result.allowed).toBe(false);