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
954 stars 77 forks source link

False Positive when Firefox developer tools enabled #157

Closed skyclad0x7b7 closed 3 months ago

skyclad0x7b7 commented 7 months ago
image
Logs ``` {"isError":false,"collectionTime":12,"detectionTime":13,"detectionResult":{"bot":true,"botKind":"unknown"},"detectedBot":"unknown","collectedData":{"rtt":{"state":-1,"error":"BotdError: navigator.connection is undefined"},"process":{"state":-1,"error":"BotdError: window.process is undefined"},"android":{"value":false,"state":0},"browserKind":{"value":"safari","state":0},"browserEngineKind":{"value":"gecko","state":0},"documentFocus":{"value":false,"state":0},"userAgent":{"value":"Mozilla/5.0 (Linux; Android 11; SAMSUNG SM-G973U) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/14.2 Chrome/87.0.4280.141 Mobile Safari/537.36","state":0},"appVersion":{"value":"5.0 (Macintosh)","state":0},"windowSize":{"value":{"outerWidth":412,"outerHeight":915,"innerWidth":412,"innerHeight":915},"state":0},"pluginsLength":{"value":5,"state":0},"pluginsArray":{"value":true,"state":0},"errorTrace":{"value":"errorTrace@https://fingerprintjs.github.io/BotD/main/main.bundle.js:1:28945\ny/

System: Apple M1 Pro, macOS Sonoma 14.1.1 Browser: Firefox Browser 120.0.1 (64-bit)

When Firefox developer tools and Responsive Design Mode enabled, Botd detect it as a bot.

xnerhu commented 6 months ago

I can confirm it also detected unknown on windows

xnerhu commented 6 months ago

Apart from a bug, which I just fixed, where getBrowserKind returned safari instead of chrome. This detection seems to be justified.

Firefox in this case seems to replace user agent with (at least on my side) Mozilla/5.0 (Linux; Android 11; SAMSUNG SM-G973U) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/14.2 Chrome/87.0.4280.141 Mobile Safari/537.36, which looks like chrome. Then detectProductSub detector looks that navigator.productSub and finds mismatched value.

In short, you got it marked as bot, because firefox modified the user agent.