{"record":{"id":"f1e1e4170e6d4717","repo":"wpscanteam/wpscan","slug":"expect-saml-requires-chrome-or-chromium-to-be-in","errorCode":null,"errorMessage":"--expect-saml requires Chrome or Chromium to be installed and available on PATH (install Chrome / Chromium, or point Ferrum at a binary via BROWSER_PATH). Underlying error: #{error.message}","messagePattern":"--expect-saml requires Chrome or Chromium to be installed and available on PATH \\(install Chrome / Chromium, or point Ferrum at a binary via BROWSER_PATH\\)\\. Underlying error: #(.+?)","errorType":"exception","errorClass":"WPScan::Error::BrowserFailed","httpStatus":null,"severity":"error","filePath":"lib/wpscan/browser_authenticator.rb","lineNumber":40,"sourceCode":"\n      serialize_cookies(cookies)\n    end\n\n    # Drives the interactive browser session and returns the resulting cookie jar.\n    # Translates Ferrum failures into BrowserFailed with a context-specific message.\n    def self.run_login_session(login_url)\n      browser = Ferrum::Browser.new(headless: false)\n\n      puts 'SAML authentication needed. Log in via the browser window that just opened, then press enter.'\n      browser.goto(login_url)\n      gets # Waits for user input\n\n      # Attempt an innocuous command to check if the browser is still responsive\n      browser.current_url\n\n      browser.cookies.all\n    rescue Ferrum::BinaryNotFoundError, Ferrum::EmptyPathError => e\n      raise WPScan::Error::BrowserFailed, chrome_not_found_message(e)\n    rescue Ferrum::Error => e\n      raise WPScan::Error::BrowserFailed,\n            'The browser was closed or failed before SAML authentication could be completed ' \\\n            \"(#{e.class}: #{e.message}).\"\n    ensure\n      browser.quit if browser&.process\n    end\n\n    def self.chrome_not_found_message(error)\n      '--expect-saml requires Chrome or Chromium to be installed and available on PATH ' \\\n        '(install Chrome / Chromium, or point Ferrum at a binary via BROWSER_PATH). ' \\\n        \"Underlying error: #{error.message}\"\n    end\n\n    def self.serialize_cookies(cookies)\n      cookies.map do |_name, cookie|\n        raise WPScan::Error::SAMLAuthenticationFailed if cookie.name.match?(COOKIE_DELIMITERS) ||\n                                                         cookie.value.to_s.match?(COOKIE_DELIMITERS)","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/wpscanteam/wpscan/blob/62c9cef471de90095f6b42245a11d0f8172d19c9/lib/wpscan/browser_authenticator.rb#L22-L58","documentation":"WPScan::Error::BrowserFailed raised in run_login_session (lib/wpscan/browser_authenticator.rb:39-40) when Ferrum raises BinaryNotFoundError or EmptyPathError while constructing Ferrum::Browser.new(headless: false). Ferrum locates a Chrome/Chromium binary by scanning PATH (or the BROWSER_PATH env var); --expect-saml cannot work without one, and the message includes the underlying Ferrum error for details.","triggerScenarios":"Running wpscan --expect-saml on a server/container/minimal VM with no Chrome or Chromium installed; BROWSER_PATH set to a wrong or non-executable path; Chrome installed via snap/flatpak whose wrapper is not on the PATH wpscan sees; calling WPScan::BrowserAuthenticator.run_login_session programmatically on a bare CI image.","commonSituations":"Alpine/Debian slim Docker images (no browser bundled); macOS where Chrome exists at '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' but Ferrum's search order misses it; hardened servers where chrome was removed; stale BROWSER_PATH from a previous chrome-chromium setup.","solutions":["Install Chrome or Chromium, e.g. apt-get install -y chromium || apt-get install -y google-chrome-stable","Or point Ferrum at the binary explicitly: export BROWSER_PATH=/usr/bin/chromium (macOS: export BROWSER_PATH='/Applications/Google Chrome.app/Contents/MacOS/Google Chrome')","Verify with: $BROWSER_PATH --version or command -v google-chrome chromium chromium-browser","In Docker, install the browser in the same image the scan runs in, not just on the host"],"exampleFix":"# before\n$ wpscan --url https://example.com --expect-saml\n# => BrowserFailed: --expect-saml requires Chrome or Chromium ... Underlying error: Could not find an executable for the browser\n\n# after\n$ export BROWSER_PATH=$(command -v chromium || command -v google-chrome)\n$ wpscan --url https://example.com --expect-saml","handlingStrategy":"validation","validationCode":"# Fail fast with a clear message before the scan starts\nrequire 'mkmf'\nbrowser_bin = ENV['BROWSER_PATH'] || %w[google-chrome chromium chromium-browser chrome].find do |b|\n  find_executable(b)\nend\nabort 'Chrome/Chromium not found: install it or set BROWSER_PATH' if browser_bin.nil?","typeGuard":null,"tryCatchPattern":"begin\n  WPScan::BrowserAuthenticator.run_login_session(login_url)\nrescue WPScan::Error::BrowserFailed => e\n  # message from chrome_not_found_message includes the underlying Ferrum error;\n  # not retryable until the environment changes\n  abort e.message\nend","preventionTips":["Bake Chrome/Chromium into any Docker image that will run --expect-saml","Pin BROWSER_PATH in the environment so Ferrum never has to guess","Smoke-test with '$BROWSER_PATH --version' in the same shell/profile that runs wpscan"],"tags":["saml","ferrum","chrome","chromium","browser-path","wpscan","ruby"],"backgroundTag":"browser-binary-not-found","analyzedSha":"62c9cef471de90095f6b42245a11d0f8172d19c9","analyzedAt":"2026-08-21T17:10:47.902Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}