Missing `firefox` import in `modules/special-scan.js` throws `ReferenceError: firefox is not defined` during Special Scans

Author: codeCraft-RitikCreated Sep 3, 2026Updated Sep 3, 2026

Description

When running special scans using the FindUserProfilesSpecial mode (which performs deep checks for Facebook, Gmail, and Google accounts), execution crashes with an unhandled ReferenceError: firefox is not defined.

This occurs because firefox.Options() is instantiated across multiple functions in modules/special-scan.js, but the firefox object is never imported from selenium-webdriver/firefox.js. Furthermore, because new firefox.Options() is called before entering the try { ... } block, the exception results in an unhandled promise rejection.


Technical Root Cause

In modules/special-scan.js, only Builder, By, and Key are imported from selenium-webdriver:

javascript
import helper from './helper.js'
import async from 'async'
import {Builder,By,Key} from 'selenium-webdriver'
// Missing: import firefox from 'selenium-webdriver/firefox.js'

However, lines 37–41, 91–95, and 143–147 invoke new firefox.Options():

javascript
// Line 37 in find_username_site_special_facebook_1:
const driver = new Builder()
  .forBrowser('firefox')
  .setFirefoxOptions(new firefox.Options().headless().windowSize({ // <-- ReferenceError: firefox is not defined
    width: 640,
    height: 480
  }))
  .build()

In comparison, modules/slow-scan.js correctly imports firefox:

javascript
import firefox from 'selenium-webdriver/firefox.js'

Steps to Reproduce

  1. Start the server: node app.js --gui (or run a scan targeting FindUserProfilesSpecial).
  2. Run a special scan for any username.
  3. Observe the crash output in the terminal:
    ReferenceError: firefox is not defined
        at find_username_site_special_facebook_1 (modules/special-scan.js:38:31)
        at ...

Impact

  • Severity: High
  • Completely breaks the FindUserProfilesSpecial scanning pipeline for all users trying to inspect Google, Gmail, and Facebook endpoints.

Proposed Solution / Patch

Add the missing import firefox at line 3 of modules/special-scan.js:

diff
--- a/modules/special-scan.js
+++ b/modules/special-scan.js
@@ -1,6 +1,7 @@
 import helper from './helper.js'
 import async from 'async'
+import firefox from 'selenium-webdriver/firefox.js'
 import {Builder,By,Key} from 'selenium-webdriver'