fix(security): restrict default safe-bin trusted dirs

This commit is contained in:
Peter Steinberger
2026-02-24 23:12:52 +00:00
parent 2d159e5e87
commit b67e600bff
6 changed files with 32 additions and 10 deletions

View File

@@ -1,14 +1,8 @@
import path from "node:path";
const DEFAULT_SAFE_BIN_TRUSTED_DIRS = [
"/bin",
"/usr/bin",
"/usr/local/bin",
"/opt/homebrew/bin",
"/opt/local/bin",
"/snap/bin",
"/run/current-system/sw/bin",
];
// Keep defaults to OS-managed immutable bins only.
// User/package-manager bins must be opted in via tools.exec.safeBinTrustedDirs.
const DEFAULT_SAFE_BIN_TRUSTED_DIRS = ["/bin", "/usr/bin"];
type TrustedSafeBinDirsParams = {
baseDirs?: readonly string[];