-
Notifications
You must be signed in to change notification settings - Fork 204
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Question about lies #147
Comments
These are great questions. For example,
How is still a mystery to me, but both novice and advanced object tampering techniques leak subtle differences from the object's native behavior. // This returns undefined in native engines
Object.getOwnPropertyDescriptor(navigator, 'hardwareConcurrency')
// => undefined
// Let's tamper with the value using a basic method
Object.defineProperty(navigator, 'hardwareConcurrency', { value: 2 })
// Now this returns the descriptor object
Object.getOwnPropertyDescriptor(navigator, 'hardwareConcurrency')
// => {value: 2, writable: false, enumerable: false, configurable: false}
Workers have their own scope separate from the window scope, so tampering with an object in one scope does not affect the other scope. Above, we changed Not all objects in the window are available to workers, and support varies per engine: https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope |
Very interesting. Thanks for the reply. |
Hi,
But instead of the 'failed undefined properties' I now get 'failed descriptor.value undefined'. What's the difference between these two lies? Thanks |
// Native return undefined
Object.getOwnPropertyDescriptor(Navigator.prototype, 'hardwareConcurrency').value
// tamper
Object.defineProperty(Object.getPrototypeOf(navigator), 'hardwareConcurrency', { value: 2 })
// Now we get 2
Object.getOwnPropertyDescriptor(Navigator.prototype, 'hardwareConcurrency').value This will bypass both tests. Idea from: Object.defineProperty(
Object.getPrototypeOf(navigator),
'hardwareConcurrency', {
get: (function hardwareConcurrency() { return 2 }).bind(null)
}
) But, then that creates a new set of leaks. For example: // this should return an error and not "Number"
Navigator.prototype.hardwareConcurrency.constructor.name There's a few interesting articles highlighting some of these leaks and potential solutions, but I'm pretty sure the only way to 100% bypass leaks is to change functions at engine level. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Hi,
What is meant by:
How does tampering with objects cause these detections?
Thanks
The text was updated successfully, but these errors were encountered: