fingerprintjs / BotD

Bot detection library that runs in the browser. Detects automation tools and frameworks. No server required, runs 100% on the client. MIT license, no usage restrictions.
https://fingerprintjs.github.io/BotD/main/
MIT License
1.06k stars 82 forks source link

False positive when we open link in Samsung browser in phone #185

Open halidz opened 1 month ago

halidz commented 1 month ago

When we try to open the link in samsung browser it detects as headless_chrome bot.

"detectNotificationPermissions": { "bot": true, "botKind": "headless_chrome" },


{
    "e": {
        "process": {
            "state": -1,
            "error": "BotdError: window.process is undefined"
        },
        "android": {
            "value": true,
            "state": 0
        },
        "browserKind": {
            "value": "chrome",
            "state": 0
        },
        "browserEngineKind": {
            "value": "chromium",
            "state": 0
        },
        "documentFocus": {
            "value": false,
            "state": 0
        },
        "userAgent": {
            "value": "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/26.0 Chrome/122.0.0.0 Mobile Safari/537.36",
            "state": 0
        },
        "appVersion": {
            "value": "5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/26.0 Chrome/122.0.0.0 Mobile Safari/537.36",
            "state": 0
        },
        "rtt": {
            "value": 0,
            "state": 0
        },
        "windowSize": {
            "value": {
                "outerWidth": 384,
                "outerHeight": 679,
                "innerWidth": 384,
                "innerHeight": 679
            },
            "state": 0
        },
        "pluginsLength": {
            "value": 0,
            "state": 0
        },
        "pluginsArray": {
            "value": true,
            "state": 0
        },
        "errorTrace": {
            "value": "TypeError: Cannot read properties of null (reading '0')\n    at errorTrace (https://d2q7bvpn94ug9o.cloudfront.net/mop/assets/js/vendors~main.e6e43d81c7bd9b8731f4.js:242:42062)\n    at https://d2q7bvpn94ug9o.cloudfront.net/mop/assets/js/vendors~main.e6e43d81c7bd9b8731f4.js:242:35802\n    at https://d2q7bvpn94ug9o.cloudfront.net/mop/assets/js/vendors~main.e6e43d81c7bd9b8731f4.js:179:10905\n    at Object.next (https://d2q7bvpn94ug9o.cloudfront.net/mop/assets/js/vendors~main.e6e43d81c7bd9b8731f4.js:179:11010)\n    at https://d2q7bvpn94ug9o.cloudfront.net/mop/assets/js/vendors~main.e6e43d81c7bd9b8731f4.js:179:9926\n    at new Promise (<anonymous>)\n    at h (https://d2q7bvpn94ug9o.cloudfront.net/mop/assets/js/vendors~main.e6e43d81c7bd9b8731f4.js:179:9671)\n    at https://d2q7bvpn94ug9o.cloudfront.net/mop/assets/js/vendors~main.e6e43d81c7bd9b8731f4.js:242:35620\n    at Array.map (<anonymous>)\n    at https://d2q7bvpn94ug9o.cloudfront.net/mop/assets/js/vendors~main.e6e43d81c7bd9b8731f4.js:242:35577",
            "state": 0
        },
        "productSub": {
            "value": "20030107",
            "state": 0
        },
        "windowExternal": {
            "value": "[object External]",
            "state": 0
        },
        "mimeTypesConsistent": {
            "value": true,
            "state": 0
        },
        "evalLength": {
            "value": 33,
            "state": 0
        },
        "webGL": {
            "value": {
                "vendor": "WebKit",
                "renderer": "WebKit WebGL"
            },
            "state": 0
        },
        "webDriver": {
            "value": false,
            "state": 0
        },
        "languages": {
            "value": [
                [
                    "tr-TR"
                ]
            ],
            "state": 0
        },
        "documentElementKeys": {
            "value": [
                "style"
            ],
            "state": 0
        },
        "functionBind": {
            "value": "function bind() { [native code] }",
            "state": 0
        },
        "distinctiveProps": {
            "value": {
                "awesomium": false,
                "cef": false,
                "cefsharp": false,
                "coachjs": false,
                "fminer": false,
                "geb": false,
                "nightmarejs": false,
                "phantomas": false,
                "phantomjs": false,
                "rhino": false,
                "selenium": false,
                "webdriverio": false,
                "webdriver": false,
                "headless_chrome": false
            },
            "state": 0
        },
        "notificationPermissions": {
            "value": true,
            "state": 0
        }
    },
    "t": {},
    "n": {
        "detectAppVersion": {
            "bot": false
        },
        "detectDocumentAttributes": {
            "bot": false
        },
        "detectErrorTrace": {
            "bot": false
        },
        "detectEvalLengthInconsistency": {
            "bot": false
        },
        "detectFunctionBind": {
            "bot": false
        },
        "detectLanguagesLengthInconsistency": {
            "bot": false
        },
        "detectNotificationPermissions": {
            "bot": true,
            "botKind": "headless_chrome"
        },
        "detectPluginsArray": {
            "bot": false
        },
        "detectPluginsLengthInconsistency": {
            "bot": false
        },
        "detectProcess": {
            "bot": false
        },
        "detectUserAgent": {
            "bot": false
        },
        "detectWebDriver": {
            "bot": false
        },
        "detectWebGL": {
            "bot": false
        },
        "detectWindowExternal": {
            "bot": false
        },
        "detectWindowSize": {
            "bot": false
        },
        "detectMimeTypesConsistent": {
            "bot": false
        },
        "detectProductSub": {
            "bot": false
        },
        "detectDistinctiveProperties": {
            "bot": false
        }
    },
    "r": {
        "bot": true,
        "botKind": "headless_chrome"
    },
    "o": "detectDistinctiveProperties",
    "u": {
        "bot": false
    }
} ```
dp-anto commented 3 weeks ago

I have the same problem here: when embedding my website (which contains the BotD library) with an iframe in another website and I open this one on the Samsung Internet Browser then my website doesn't load.

xnerhu commented 3 weeks ago

Logs from my phone samsung browser:

{
  "isError": false,
  "collectionTime": 83.29999999701977,
  "detectionTime": 83.70000000298023,
  "detectionResult": {
    "bot": false
  },
  "collectedData": {
    "process": {
      "state": -1,
      "error": "BotdError: window.process is undefined"
    },
    "android": {
      "value": true,
      "state": 0
    },
    "browserKind": {
      "value": "chrome",
      "state": 0
    },
    "browserEngineKind": {
      "value": "chromium",
      "state": 0
    },
    "documentFocus": {
      "value": true,
      "state": 0
    },
    "userAgent": {
      "value": "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/26.0 Chrome/122.0.0.0 Mobile Safari/537.36",
      "state": 0
    },
    "appVersion": {
      "value": "5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/26.0 Chrome/122.0.0.0 Mobile Safari/537.36",
      "state": 0
    },
    "rtt": {
      "value": 0,
      "state": 0
    },
    "windowSize": {
      "value": {
        "outerWidth": 360,
        "outerHeight": 640,
        "innerWidth": 360,
        "innerHeight": 640
      },
      "state": 0
    },
    "pluginsLength": {
      "value": 0,
      "state": 0
    },
    "pluginsArray": {
      "value": true,
      "state": 0
    },
    "errorTrace": {
      "value": "TypeError: Cannot read properties of null (reading '0')\n    at errorTrace (https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:45895)\n    at https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:39515\n    at https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:38324\n    at Object.next (https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:38429)\n    at https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:37345\n    at new Promise (<anonymous>)\n    at e (https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:37090)\n    at https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:39352\n    at Array.map (<anonymous>)\n    at https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:39328",
      "state": 0
    },
    "productSub": {
      "value": "20030107",
      "state": 0
    },
    "windowExternal": {
      "value": "[object External]",
      "state": 0
    },
    "mimeTypesConsistent": {
      "value": true,
      "state": 0
    },
    "evalLength": {
      "value": 33,
      "state": 0
    },
    "webGL": {
      "value": {
        "vendor": "WebKit",
        "renderer": "WebKit WebGL"
      },
      "state": 0
    },
    "webDriver": {
      "value": false,
      "state": 0
    },
    "languages": {
      "value": [
        [
          "en-US"
        ]
      ],
      "state": 0
    },
    "documentElementKeys": {
      "value": [
        "lang"
      ],
      "state": 0
    },
    "functionBind": {
      "value": "function bind() { [native code] }",
      "state": 0
    },
    "distinctiveProps": {
      "value": {
        "awesomium": false,
        "cef": false,
        "cefsharp": false,
        "coachjs": false,
        "fminer": false,
        "geb": false,
        "nightmarejs": false,
        "phantomas": false,
        "phantomjs": false,
        "rhino": false,
        "selenium": false,
        "webdriverio": false,
        "webdriver": false,
        "headless_chrome": false
      },
      "state": 0
    },
    "notificationPermissions": {
      "value": false,
      "state": 0
    }
  },
  "detectorsResults": {
    "detectAppVersion": {
      "bot": false
    },
    "detectDocumentAttributes": {
      "bot": false
    },
    "detectErrorTrace": {
      "bot": false
    },
    "detectEvalLengthInconsistency": {
      "bot": false
    },
    "detectFunctionBind": {
      "bot": false
    },
    "detectLanguagesLengthInconsistency": {
      "bot": false
    },
    "detectNotificationPermissions": {
      "bot": false
    },
    "detectPluginsArray": {
      "bot": false
    },
    "detectPluginsLengthInconsistency": {
      "bot": false
    },
    "detectProcess": {
      "bot": false
    },
    "detectUserAgent": {
      "bot": false
    },
    "detectWebDriver": {
      "bot": false
    },
    "detectWebGL": {
      "bot": false
    },
    "detectWindowExternal": {
      "bot": false
    },
    "detectWindowSize": {
      "bot": false
    },
    "detectMimeTypesConsistent": {
      "bot": false
    },
    "detectProductSub": {
      "bot": false
    },
    "detectDistinctiveProperties": {
      "bot": false
    }
  },
  "debugData": {
    "browserEngineKind": "chromium",
    "browserKind": "chrome",
    "browserVersion": {
      "major": 26,
      "minor": 0
    },
    "documentFocus": true,
    "mozAppearanceSupport": false,
    "isAndroid": true,
    "isDesktopWebKit": false,
    "isIPad": true
  }
}
xnerhu commented 3 weeks ago

The difference is notificationPermissions, which in your case is true.

halidz commented 3 weeks ago

Can you explain why it comes as true? our case is we have our iframe embedded on another website. and when we open this website on Samsung Browser notificationPermissions value comes as true and it assumes as headless_chrome bot but its a false positive.