ruvnet/ruflo · error · Error

Command not allowed: ${cmd.split(' ')[0]}

Error message

Command not allowed: ${cmd.split(' ')[0]}

What it means

validateCommand() in the release manager requires the command to start with one of the ALLOWED_GIT_COMMANDS prefixes (git status, git log, git tag, git add, git commit, git describe, and the other git-prefixed entries). The first word of any non-matching command is echoed back in the error so the caller can see which token was refused.

Source

Thrown at v3/@claude-flow/deployment/src/release-manager.ts:35

  'git tag',
  'git add',
  'git commit',
  'git describe',
];

/**
 * Validate command against allowlist to prevent command injection
 */
function validateCommand(cmd: string): void {
  // Check for shell metacharacters
  if (/[;&|`$()<>]/.test(cmd)) {
    throw new Error(`Invalid command: contains shell metacharacters`);
  }

  // Must start with an allowed command prefix
  const isAllowed = ALLOWED_GIT_COMMANDS.some(prefix => cmd.startsWith(prefix));
  if (!isAllowed) {
    throw new Error(`Command not allowed: ${cmd.split(' ')[0]}`);
  }
}
import type {
  ReleaseOptions,
  ReleaseResult,
  PackageInfo,
  GitCommit,
  ChangelogEntry,
  VersionBumpType
} from './types.js';

export class ReleaseManager {
  private cwd: string;

  constructor(cwd: string = process.cwd()) {
    this.cwd = cwd;
  }

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Run npm-related steps through Publisher (which allows npm/npx/pnpm/yarn) and keep only git operations in ReleaseManager
  2. Wrap non-git commands outside these classes with your own exec call rather than bypassing the allowlist
  3. Check the ALLOWED_GIT_COMMANDS list in release-manager.ts before adding new internal steps
Defensive patterns

Strategy: validation

Validate before calling

const ALLOWED_GIT = ['git status', 'git log', 'git tag', 'git add', 'git commit', 'git describe'];
function isAllowedGitCommand(cmd: string): boolean {
  return ALLOWED_GIT.some(p => cmd.startsWith(p)) && !/[;&|`$()<>]/.test(cmd);
}

Prevention

When it happens

Trigger: A command string reaching ReleaseManager's execCommand that starts with anything but an allowlisted git subcommand — 'npm ...', 'ls', 'gh release ...', 'echo ...'.

Common situations: Extending the release flow to run npm or GitHub CLI steps through the same manager; patched or subclassed flows that assume the publisher's wider (npm/npx/pnpm/yarn) allowlist applies here too.

Related errors


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/2510295a932d9f04. Report an issue: GitHub.