{"record":{"id":"0e6fd04de6b50deb","repo":"presidentbeef/brakeman","slug":"could-not-find-specified-check-missing-length-1","errorCode":null,"errorMessage":"Could not find specified check#{missing.length > 1 ? 's' : ''}: #{missing.map {|c| \"`#{c}`\"}.join(', ')}","messagePattern":"Could not find specified check#(.+?): #(.+?)`\"\\}\\.join\\(', '\\)\\}","errorType":"exception","errorClass":"MissingChecksError","httpStatus":null,"severity":"error","filePath":"lib/brakeman.rb","lineNumber":656,"sourceCode":"      end\n    end\n\n    tracker.ignored_filter = config\n  end\n\n  def self.add_external_checks options\n    options[:additional_checks_path].each do |path|\n      Brakeman::Checks.initialize_checks path\n    end if options[:additional_checks_path]\n  end\n\n  def self.check_for_missing_checks included_checks, excluded_checks, enabled_checks\n    checks = included_checks.to_a + excluded_checks.to_a + enabled_checks.to_a\n\n    missing = Brakeman::Checks.missing_checks(checks)\n\n    unless missing.empty?\n      raise MissingChecksError, \"Could not find specified check#{missing.length > 1 ? 's' : ''}: #{missing.map {|c| \"`#{c}`\"}.join(', ')}\"\n    end\n  end\n\n  def self.debug= val\n    @debug = val\n  end\n\n  def self.quiet= val\n    @quiet = val\n  end\n\n  def self.process_step(description, &)\n    logger.context(description, &)\n  end\n\n  class DependencyError < RuntimeError; end\n  class NoBrakemanError < RuntimeError; end\n  class NoApplication < RuntimeError; end","sourceCodeStart":638,"sourceCodeEnd":674,"githubUrl":"https://github.com/presidentbeef/brakeman/blob/649e678d0a46bda0e7c35874fa7af5d16e19b4f1/lib/brakeman.rb#L638-L674","documentation":"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.","triggerScenarios":"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`).","commonSituations":"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.","solutions":["List the checks available in your installed version: `brakeman --checks` (optionally `--optional-checks`) and copy the exact names.","Fix the typo/rename in the `-k`/`-x`/`--enable` list to match the listed names.","For custom checks, pass the correct load path first (`--add-checks-path path/to/checks`) and remember optional checks must be explicitly `--enable`d.","If the name came from an old config, consult the CHANGES.md of your Brakeman version for renamed/removed checks and update the config."],"exampleFix":"# before\nbrakeman -k CrossSiteScriptin,SQL\n# => MissingChecksError: Could not find specified check: `CrossSiteScriptin`\n\n# after (correct names, verified via `brakeman --checks`)\nbrakeman -k CrossSiteScripting,SQL","handlingStrategy":"validation","validationCode":"# Ruby, use Brakeman's own registry to pre-validate names\nnames = %w[CrossSiteScripting SQL MyCustomCheck]\nmissing = Brakeman::Checks.missing_checks(names)\nraise Brakeman::MissingChecksError, \"Unknown: #{missing.join(', ')}\" unless missing.empty?\n\nBrakeman.run :app_path => app, :run_checks => names","typeGuard":null,"tryCatchPattern":"begin\n  Brakeman.run :app_path => app, :run_checks => names\nrescue Brakeman::MissingChecksError => e\n  abort \"#{e.message} — run `brakeman --checks` to list valid names.\" # or fix names and retry\nend","preventionTips":["After every Brakeman upgrade, re-validate configured check names against `brakeman --checks` / `--optional-checks` in CI.","When using custom checks, always pass --add-checks-path and prefer fingerprints/names verified in a smoke run.","Treat this error as a hard failure, not a warning: an unknown check name means your intended scan scope is not being applied."],"tags":["brakeman","checks","typo","cli","upgrade","custom-checks"],"backgroundTag":"unknown-check-name","analyzedSha":"649e678d0a46bda0e7c35874fa7af5d16e19b4f1","analyzedAt":"2026-08-21T18:43:10.938Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}