@wrongstack/tools 0.8.0 → 0.8.2

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/builtin.js CHANGED
@@ -3337,8 +3337,11 @@ var BLOCKED_ARG_PATTERNS = {
3337
3337
  docker: [/^build$/, /^run$/, /^exec$/, /^push$/, /^pull$/],
3338
3338
  // find -exec/-ok/-execdir execute arbitrary commands
3339
3339
  find: [/^-exec$/, /^-exec;$/, /^-ok$/, /^-ok;$/, /^-execdir$/, /^-execdir;$/, /^-exec=/, /^-ok=/, /^-execdir=/],
3340
- // rm -rf / is catastrophic — block absolute paths, home, and dot-dir targets
3341
- rm: [/^\//, /^~/, /^\.{1,2}$/],
3340
+ // rm -rf / is catastrophic — block absolute paths, home, dot-dirs,
3341
+ // and glob patterns that could expand to dangerous targets.
3342
+ // `rm -rf ./src/*` expands to project files; `rm -rf ../../` escapes upward;
3343
+ // `rm -rf /*` targets the filesystem root. All are blocked.
3344
+ rm: [/^\//, /^~\//, /^~$/, /^\.$/, /^\.\.$/, /\*$/, /\/$/, /\/\*$/, /\.\//],
3342
3345
  // npm run/exec/create/pack/publish can execute arbitrary scripts or publish malware
3343
3346
  npm: [/^run$/, /^exec$/, /^create$/, /^init$/, /^pack$/, /^publish$/, /^deploy$/],
3344
3347
  // pnpm run/dlx/exec/create can execute arbitrary scripts
@@ -4553,7 +4556,7 @@ var installTool = {
4553
4556
  ) : [];
4554
4557
  const PKG_NAME_RE = /^(?:@[a-z0-9._-]+\/)?[a-z0-9._-]+$/i;
4555
4558
  for (const pkg of pkgList) {
4556
- if (!PKG_NAME_RE.test(pkg) || pkg.startsWith("-")) {
4559
+ if (!PKG_NAME_RE.test(pkg) || pkg.startsWith("-") || pkg.length > 200) {
4557
4560
  yield {
4558
4561
  type: "final",
4559
4562
  output: {