@beastmode-develeap/beastmode 0.1.324 → 0.1.325

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -6387,8 +6387,19 @@ function getBoardRoutes(factoryDir) {
6387
6387
  const repoName = url.replace(/\.git$/, "").split(/[/:]/).filter(Boolean).pop() || "";
6388
6388
  if (!repoName) throw new Error("Could not derive repo name from URL");
6389
6389
  const baseDir = clone_target ? resolve4(clone_target) : process.env.BEASTMODE_CLONE_DIR ? resolve4(process.env.BEASTMODE_CLONE_DIR) : join14(homedir(), "repos");
6390
+ const allowedRoots = _getAllowedRoots();
6391
+ if (!_isPathAllowed(baseDir, allowedRoots)) {
6392
+ throw new Error(
6393
+ `clone_target not allowed: ${baseDir} is outside the configured allowlist`
6394
+ );
6395
+ }
6390
6396
  if (!existsSync16(baseDir)) mkdirSync12(baseDir, { recursive: true });
6391
6397
  resolvedPath = join14(baseDir, repoName);
6398
+ if (!_isPathAllowed(resolvedPath, allowedRoots)) {
6399
+ throw new Error(
6400
+ `clone_target not allowed: ${resolvedPath} is outside the configured allowlist`
6401
+ );
6402
+ }
6392
6403
  if (existsSync16(resolvedPath)) {
6393
6404
  throw new Error(`Target path already exists: ${resolvedPath} \u2014 pick a different clone_target or rename the existing folder`);
6394
6405
  }