presidentbeef/brakeman · error · MissingChecksError

Could not find specified check#{missing.length > 1 ? 's' : '

Error message

Could not find specified check#{missing.length > 1 ? 's' : ''}: #{missing.map {|c| "`#{c}`"}.join(', ')}

What it means

After checks are loaded, Brakeman validates every check name passed via `-k/--checks <names>` (run only), `-x/--skip-checks`, and `--enable` against its registry of known checks; any name `Brakeman::Checks.missing_checks` reports is collected and the run aborts with `Brakeman::MissingChecksError` listing the unknown names. This catches typos and stale names before a scan that would silently skip the intended checks.

Source

Thrown at lib/brakeman.rb:656

      end
    end

    tracker.ignored_filter = config
  end

  def self.add_external_checks options
    options[:additional_checks_path].each do |path|
      Brakeman::Checks.initialize_checks path
    end if options[:additional_checks_path]
  end

  def self.check_for_missing_checks included_checks, excluded_checks, enabled_checks
    checks = included_checks.to_a + excluded_checks.to_a + enabled_checks.to_a

    missing = Brakeman::Checks.missing_checks(checks)

    unless missing.empty?
      raise MissingChecksError, "Could not find specified check#{missing.length > 1 ? 's' : ''}: #{missing.map {|c| "`#{c}`"}.join(', ')}"
    end
  end

  def self.debug= val
    @debug = val
  end

  def self.quiet= val
    @quiet = val
  end

  def self.process_step(description, &)
    logger.context(description, &)
  end

  class DependencyError < RuntimeError; end
  class NoBrakemanError < RuntimeError; end
  class NoApplication < RuntimeError; end

View on GitHub (pinned to 649e678d0a)

Solutions

  1. List the checks available in your installed version: `brakeman --checks` (optionally `--optional-checks`) and copy the exact names.
  2. Fix the typo/rename in the `-k`/`-x`/`--enable` list to match the listed names.
  3. For custom checks, pass the correct load path first (`--add-checks-path path/to/checks`) and remember optional checks must be explicitly `--enable`d.
  4. If the name came from an old config, consult the CHANGES.md of your Brakeman version for renamed/removed checks and update the config.

Example fix

# before
brakeman -k CrossSiteScriptin,SQL
# => MissingChecksError: Could not find specified check: `CrossSiteScriptin`

# after (correct names, verified via `brakeman --checks`)
brakeman -k CrossSiteScripting,SQL
Defensive patterns

Strategy: validation

Validate before calling

# Ruby, use Brakeman's own registry to pre-validate names
names = %w[CrossSiteScripting SQL MyCustomCheck]
missing = Brakeman::Checks.missing_checks(names)
raise Brakeman::MissingChecksError, "Unknown: #{missing.join(', ')}" unless missing.empty?

Brakeman.run :app_path => app, :run_checks => names

Try / catch

begin
  Brakeman.run :app_path => app, :run_checks => names
rescue Brakeman::MissingChecksError => e
  abort "#{e.message} — run `brakeman --checks` to list valid names." # or fix names and retry
end

Prevention

When it happens

Trigger: Running `brakeman -k CrossSiteScriptin` (typo), referencing a check that was renamed or removed after upgrading Brakeman (e.g. old check names in a shared CI config), or pointing at a custom/optional check without first making its path loadable via `--add-checks-path` (optional checks also need `--enable`).

Common situations: A version pin bumped in one repo while the central CI template still lists old check names; custom in-house checks used with `--add-checks-path` where the path argument is wrong or the checks directory moved; copying a `-k` list from an old blog post or another tool's config.

Related errors


AI-assisted analysis of presidentbeef/brakeman@649e678d0a (2026-08-21). Data as JSON: /api/errors/0e6fd04de6b50deb. Report an issue: GitHub.