fix: sandbox deny patterns - use (\s|$) instead of \b for find / and ls /

This commit is contained in:
Slobodan Ilic 2026-04-27 14:39:39 +00:00
parent a11f19b841
commit 91201720e2

View file

@ -95,8 +95,8 @@ var (
regexp.MustCompile(`\bssh\b.*@`),
regexp.MustCompile(`\beval\b`),
regexp.MustCompile(`\bsource\s+.*\.sh\b`),
regexp.MustCompile(`\bfind\s+/\b`), // find / - traverse entire filesystem
regexp.MustCompile(`\bls\s+/\b`), // ls / - list root directory
regexp.MustCompile(`\bfind\s+/(\s|$)`), // find / - traverse entire filesystem
regexp.MustCompile(`\bls\s+/(\s|$)`), // ls / - list root directory
}
// absolutePathPattern matches absolute file paths in commands (Unix and Windows).