clientjs icon indicating copy to clipboard operation
clientjs copied to clipboard

Android/Chrome device alternates between 2 fingerprints

Open d3r3kr0b3rts opened this issue 5 years ago • 4 comments

This is a great project, very simple to install and use and mostly it's working as intended. Thank you for making this available and your hard work putting it together.

I'm using clientjs in a project that fingerprints the device and stores the fingerprint in a database. If the value of the cookie on the device and the fingerprint of the device don't match what is stored in the database then the old cookie is unset and a new cookie and fingerprint are set on the device. This is working fine on 2 desktop Windows/Chrome devices but on 2 different Android/Chrome devices the program will get stuck in a loop where it alternates between the following 2 fingerprints. The first fingerprint value will be stored in the db, then on a page reload the device fingerprint will no longer match with the database fingerprint so the second fingerprint is stored, then on a page reload the second device fingerprint will no longer match and the first device fingerprint is stored again. I've included both of the fingerprints hoping that it would be useful. This happens using the client.getFingerprint() method.

[edit] I remember these are md5 hashes of the fingerprints, not the fingerprints themselves. 166fe3d7c2604fee688d8d18b0ad6ecd and then ceb983f07355b3750b34d1d7723d648f

d3r3kr0b3rts avatar Mar 20 '19 19:03 d3r3kr0b3rts

I think I've narrowed the issue down to the getCanvasPrint function returning different results but I don't know enough about the canvas element to determine why. This is unfortunate since the canvasprint seems to be one of the more unique data points. The solution I'm going with for now is to run a check for mobile and then perform the standard fingerprint on desktop and a custom fingerprint on mobile which doesn't use the canvasprint data point.

var client = new ClientJS(); // Create A New Client Object var mobilecheck = client.isMobile(); if(mobilecheck == false) { var fingerprint = client.getFingerprint(); // Calculate Device/Browser Fingerprint }else{ var a = client.getBrowser(); var b = client.getEngine(); var c = client.getOS(); var d = client.getOSVersion(); var e = client.getPlugins(); var f = client.getFonts(); var g = client.getTimeZone(); var h = client.getLanguage(); // var i = client.getCanvasPrint(); var fingerprint = client.getCustomFingerprint(a,b,c,d,e,f,g,h); }

d3r3kr0b3rts avatar Mar 20 '19 21:03 d3r3kr0b3rts

I think I've narrowed the issue down to the getCanvasPrint function returning different results but I don't know enough about the canvas element to determine why. This is unfortunate since the canvasprint seems to be one of the more unique data points. The solution I'm going with for now is to run a check for mobile and then perform the standard fingerprint on desktop and a custom fingerprint on mobile which doesn't use the canvasprint data point.

var client = new ClientJS(); // Create A New Client Object var mobilecheck = client.isMobile(); if(mobilecheck == false) { var fingerprint = client.getFingerprint(); // Calculate Device/Browser Fingerprint }else{ var a = client.getBrowser(); var b = client.getEngine(); var c = client.getOS(); var d = client.getOSVersion(); var e = client.getPlugins(); var f = client.getFonts(); var g = client.getTimeZone(); var h = client.getLanguage(); // var i = client.getCanvasPrint(); var fingerprint = client.getCustomFingerprint(a,b,c,d,e,f,g,h); }

Having the same issue. I'll investigate a bit to see what might be the issue.

lsteixeira avatar Oct 22 '19 18:10 lsteixeira

I‘m having the same issue on an iPad, however the two fingerprints seem to alternate consistently according to screen orientation. I was able to reproduce this behavior on an iPhone as well.

soberdor avatar Dec 01 '19 23:12 soberdor

the same issue here

MrAlekhin avatar Jul 18 '22 01:07 MrAlekhin