Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive when browser internal pdf is enabled #135

Open
TLeiter opened this issue Aug 2, 2023 · 9 comments · Fixed by #153
Open

False positive when browser internal pdf is enabled #135

TLeiter opened this issue Aug 2, 2023 · 9 comments · Fixed by #153
Labels
bug Something isn't working false-positive help wanted Extra attention is needed

Comments

@TLeiter
Copy link

TLeiter commented Aug 2, 2023

In Edge and Chrome if the setting "Open PDF in Chrome/Edge" is enabled (Settings > Privacy and security > Site settings > Additional content settings > PDF documents.), then the value navigator.plugins is empty which evalute the bot test to true.

@TLeiter
Copy link
Author

TLeiter commented Oct 2, 2023

Tested and not currently fixed.

@xnerhu
Copy link
Contributor

xnerhu commented Oct 2, 2023

Tested and not currently fixed.

Can you make sure you are on the latest version? Also please, send me botd snapshot from playgrond https://fingerprintjs.github.io/BotD/main/

@xnerhu xnerhu reopened this Oct 2, 2023
@TLeiter
Copy link
Author

TLeiter commented Oct 2, 2023

Hello,

Hre is the snapshot from the playground:

{"isError":false,"collectionTime":20.199999928474426,"detectionTime":21.299999952316284,"detectionResult":{"bot":true,"botKind":"headless_chrome"},"detectedBot":"headless_chrome","collectedData":{"process":{"state":-1,"error":"BotdError: window.process is undefined"},"userAgent":{"value":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36","state":0},"appVersion":{"value":"5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36","state":0},"rtt":{"value":0,"state":0},"windowSize":{"value":{"outerWidth":2048,"outerHeight":1152,"innerWidth":2048,"innerHeight":1043},"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:27921)\n/n) at n. (https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:33455)\n/n) at https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:21466\n at Object.next (https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:21571)\n/n) at https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:20487\n at new Promise ()\n at e (https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:20232)\n/n) at https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:33292\n at Array.map ()\n at n. ([https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:33268)","state":0},"productSub":{"value":"20030107","state":0},"windowExternal":{"value":"object%22,%22state%22:0%7d,%22productSub%22:%7b%22value%22:%2220030107%22,%22state%22:0%7d,%22windowExternal%22:%7b%22value%22:%22%5bobject) 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":true,"botKind":"headless_chrome"},"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","documentFocus":true,"mozAppearanceSupport":false,"isAndroid":false,"isDesktopWebKit":false}}

@xnerhu
Copy link
Contributor

xnerhu commented Nov 5, 2023

@TLeiter I added support for detecting edge as BrowserKind, so it should fix the issue

@AnastasiaPlague
Copy link

We are encountering the same problem using the playground on latest Chrome, Chrome 119, Chrome 116. Steps are the same as the issue author described.

Would you look into it again?

{
  "isError": false,
  "collectionTime": 45.8000000002794,
  "detectionTime": 47.3000000002794,
  "detectionResult": { "bot": true, "botKind": "headless_chrome" },
  "detectedBot": "headless_chrome",
  "collectedData": {
    "process": {
      "state": -1,
      "error": "BotdError: window.process is undefined"
    },
    "android": { "value": false, "state": 0 },
    "browserKind": { "value": "chrome", "state": 0 },
    "browserEngineKind": { "value": "chromium", "state": 0 },
    "documentFocus": { "value": true, "state": 0 },
    "userAgent": {
      "value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
      "state": 0
    },
    "appVersion": {
      "value": "5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
      "state": 0
    },
    "rtt": { "value": 100, "state": 0 },
    "windowSize": {
      "value": {
        "outerWidth": 1920,
        "outerHeight": 1040,
        "innerWidth": 1920,
        "innerHeight": 953
      },
      "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:45891)\n    at https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:39573\n    at https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:38227\n    at Object.next (https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:38332)\n    at https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:37248\n    at new Promise (<anonymous>)\n    at e (https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:36993)\n    at https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:39410\n    at Array.map (<anonymous>)\n    at https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:39386",
      "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": [["ru-RU"]], "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": true,
      "botKind": "headless_chrome"
    },
    "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": 120, "minor": 0 },
    "documentFocus": true,
    "mozAppearanceSupport": false,
    "isAndroid": false,
    "isDesktopWebKit": false,
    "isIPad": true
  }
}

@xnerhu
Copy link
Contributor

xnerhu commented Jan 16, 2024

AnastasiaPlague

Of course.

@xnerhu xnerhu reopened this Jan 16, 2024
@hwangzhiming
Copy link

If the user sets Download PDFs instead of Open PDFs in Chrome in Chrome, the length of the plugin array will be 0, causing a false positive for headless detection. any solutions?
image

@nketkar
Copy link

nketkar commented Jul 23, 2024

I am also seeing a lot of false positives on the length of the Plugin array being 0. It appears the navigator.plugins array is deprecated anyways: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/plugins

Can this rule be removed for good?

@Jackenmen
Copy link

I'm also running into this one as a user of one of the sites that use this lib, took me a while to figure out why, wish I knew that the lib has a playground 😄

logs
{"isError":false,"collectionTime":7.300000000745058,"detectionTime":7.400000002235174,"detectionResult":{"bot":true,"botKind":"headless_chrome"},"detectedBot":"headless_chrome","collectedData":{"process":{"state":-1,"error":"BotdError: window.process is undefined"},"android":{"value":false,"state":0},"browserKind":{"value":"chrome","state":0},"browserEngineKind":{"value":"chromium","state":0},"documentFocus":{"value":true,"state":0},"userAgent":{"value":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36","state":0},"appVersion":{"value":"5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36","state":0},"rtt":{"value":50,"state":0},"windowSize":{"value":{"outerWidth":1920,"outerHeight":1051,"innerWidth":1920,"innerHeight":964},"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:45891)\n    at https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:39573\n    at https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:38227\n    at Object.next (https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:38332)\n    at https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:37248\n    at new Promise (<anonymous>)\n    at e (https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:36993)\n    at https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:39410\n    at Array.map (<anonymous>)\n    at https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:39386","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":true,"botKind":"headless_chrome"},"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":127,"minor":0},"documentFocus":true,"mozAppearanceSupport":false,"isAndroid":false,"isDesktopWebKit":false,"isIPad":true}}

@xnerhu xnerhu added the help wanted Extra attention is needed label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working false-positive help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants