News for hackers. Stuff that matters.
Re:Virtual Machine Detection in the Browser (2019) by userbinator on Friday December 18, 2020 @10:01PM (#25474587)
quickly realized that some of the fingerprinting information could be useful for VM detection because vendor names were exposed. In this particular instance the string "VMWare" was contained within the WebGL information. After some more testing I also discovered that VirtualBox reported the same kind of information.

I believe there are patches that can close those holes, but I've always found the fact that such information is exposed by default and can thus make a VM obviously not look more like real hardware is puzzling. Ideally, a VM should be indistinguishable from real hardware, and in practice that ideal is difficult to achieve --- especially with timing-based detections --- but you'd think such obvious signs wouldn't appear.

Also, the amount of information that can be gathered via JS is disturbingly immense. To me, this is just further validation of the fact that JS needs to be off by default and whitelisted only for the (very few) sites that one truly trusts.

Re:Virtual Machine Detection in the Browser (2019) by xxpor on Friday December 18, 2020 @10:15PM (#25474654)
There's a lot of paravirtualized devices even within an HVM type of VM. This is necessary for performance. You don't want to have to emulate a lot of things if you don't have to.

https://wiki.libvirt.org/page/Virtio

Re:Virtual Machine Detection in the Browser (2019) by twelvechairs on Saturday December 19, 2020 @05:33AM (#25476540)
> JS needs to be off by default and whitelisted only for the (very few) sites that one truly trusts.

Or the information provided by JS regarding the local machine should be reduced

Re:Virtual Machine Detection in the Browser (2019) by kaashmonee on Saturday December 19, 2020 @10:32AM (#25477977)
I feel like this might be a better and more feasible solution. Is there a reason that JS can collect as much data as it does about our hardware? I feel like I always hear the mantra, "The browser is a sandbox," but reading articles like this make me really unconfident that that is true. I don't really have too much of an idea of how WebGL works, but I wonder if there's a way to create some sort of additional abstraction layer between a website and the hardware? So JS just has access to "hardware interfaces" like a CPU and a GPU but can only interact with via this interface. That way, even if a site wanted to, the best it could do is determine that your computer has a GPU or a CPU but not how many cores or what type of GPU?

This would however have the downside of incurring an additional latency with an additional abstraction, but if there was a way you turn this off with trusted websites and only leave it on when you're using a site you don't trust it could be more usable? It just seems better than disabling JS entirely since a lot of websites just completely break without JS.

It just seems like with the amount of information that JS can collect, even if you're using TOR or a VPN, if you crunch all the information about a particular user, like the kind of OS they're running, the version of the browser, the screen ratio, mouse click movements, time of access, number of CPU cores, type of GPU, whether or not it's a VM, etc., it just feels like you might be able to devise a pretty reasonable heuristic for where this person is and the kind of computer they're using. I can't really say I know the extent of browser and JS capabilities, but these things already seem alarming enough where I wouldn't really feel super confident that I can't be tracked even with TOR or a VPN.

Edit: Just discovered something similar to this is being worked on already! https://gpuweb.github.io/gpuweb/#malicious-use

Re:Virtual Machine Detection in the Browser (2019) by zzo38computer on Sunday December 20, 2020 @04:52AM (#25485101)
The user should have full control over everything. For example, if the user want to configure it so that all JavaScript time reporting reports that everything takes zero time, then that is what it should do in that case. If the user wants all timeouts to expire immediately (so that JavaScript-based animations will take zero time), that can also be done, then.

You should have enough ropes to hang yourself, and also a few more just in case.

Re:Virtual Machine Detection in the Browser (2019) by Wowfunhappy on Friday December 18, 2020 @10:36PM (#25474769)
> I've always found the fact that such information is exposed by default and can thus make a VM obviously not look more like real hardware is puzzling.

Eh, it seems to me that software ought to be cooperative by default. Plenty of programs will detect whether you have AMD or nVidia graphics and optimize itself for your hardware—why not VMWare graphics?

Where I agree is that there ought to be an easy checkbox to hide it.

Re:Virtual Machine Detection in the Browser (2019) by ogre_codes on Friday December 18, 2020 @11:20PM (#25474990)
I agree with this in most cases, but when it comes to Javascript and fingerprinting, I think systems should be as generic as possible. This isn't even a VM versus bare metal thing.
Re:Virtual Machine Detection in the Browser (2019) by Wowfunhappy on Friday December 18, 2020 @11:22PM (#25474995)
Right, and so browsers need to fix this! Not because of VMs but because a web page, unlike desktop software, has no business knowing my graphics card.
Re:Virtual Machine Detection in the Browser (2019) by grimli333 on Friday December 18, 2020 @11:37PM (#25475073)
Well, presumably there may be valid use cases for WebGL applications or games behaving differently according to specific vendors/drivers.

It feels like something that needs to be asked permission for, however, so it can’t be used for nefarious purposes.

Re:Virtual Machine Detection in the Browser (2019) by Wowfunhappy on Friday December 18, 2020 @11:44PM (#25475115)
...I don't know. I realize this is an entirely subjective view of what a web page should be, but I just don't think any website should know the intricacies of my hardware. The web is a low-friction, low-trust environment; installing a desktop app has more friction, but it also acts as a signal of greater trust.

If a website ever really needs to know my hardware, it can ask me to choose from a drop-down. A lot of users won't know what hardware they have—but, those users are also unlikely to understand the implications of a hardware-detection permission prompt.

Re:Virtual Machine Detection in the Browser (2019) by yjftsjthsd-h on Saturday December 19, 2020 @12:37AM (#25475365)
I mean, it's the usual duality. If a browser is for browsing documents, then of course you don't need that. And if a browser is a method for running arbitrary applications pseudo-safely, then it absolutely should be doing that.
Re:Virtual Machine Detection in the Browser (2019) by PurpleFoxy on Saturday December 19, 2020 @12:42AM (#25475388)
The web APIs seem to be filled with features that in theory could be useful but you would have to do some serious hunting to find a legitimate user while you are flooded with examples of evil uses.

Firefox removed the battery API for this. In theory you could do something like show a stripped down site for low power users or something but it was only ever used for tracking.

While browsers have been used for a lot now, gaming seems like the one place we have seen virtually no use outside of random 2D games. I doubt there is a single web game that actually makes useful use of the gpu vendor details.

Re:Virtual Machine Detection in the Browser (2019) by tomaszs on Saturday December 19, 2020 @03:20AM (#25476031)
The problem with limiting browser features is that it makes web apps less competitive with apps on propertiary platforms. I agree not all websites should have access to battery API, but the user should decide on that, not a browser vendor. The same goes for all other limitations imposed.
Re:Virtual Machine Detection in the Browser (2019) by pksebben on Saturday December 19, 2020 @07:01AM (#25476899)
I think the sane argument here is for sensible defaults. Leaving all those switches turned on is just opening the door for adtech. The set of information that's made available out of the box should be small, and if you need to access information about my graphics card, you can ask for it.
Re:Virtual Machine Detection in the Browser (2019) by Wowfunhappy on Saturday December 19, 2020 @09:55AM (#25477732)
I think this only works if the average consumer can assess what is being asked for, though. “Do you want to let this website know what hardware you have?” is not a simple question.

“What is hardware?”

“Should I let a game know my hardware? Should I let a news website know my hardware?”

Re:Virtual Machine Detection in the Browser (2019) by tomaszs on Saturday December 19, 2020 @10:53AM (#25478139)
It is a discussion how to do it right. And surely, if propertiary platforms can do it, browsers can do it too. Especially propertiary platform app has permission to the system data enabled on default. Browser asking for it, would make web apps safer than native ones
Re:Virtual Machine Detection in the Browser (2019) by pksebben on Thursday December 24, 2020 @11:45PM (#25534269)
If one does not understand what they are being asked to consent to, they are incapable of giving informed consent.
Re:Virtual Machine Detection in the Browser (2019) by ogre_codes on Friday December 18, 2020 @11:34PM (#25475057)
> Right, and so browsers need to fix this!

Makes sense to me. There are a lot of legitimate reasons software on your computer might need to know it's in a VM or what the limits of your VR engine are.

Re:Virtual Machine Detection in the Browser (2019) by zensavona on Friday December 18, 2020 @10:51PM (#25474845)
And most importantly, it should be checked by default IMO
Re:Virtual Machine Detection in the Browser (2019) by Wowfunhappy on Friday December 18, 2020 @10:58PM (#25474887)
...no, that's where I don't agree. Again, software should attempt to be truthful by default. There's a reason we allow programs to detect the hardware they're running on—it allows for all sorts of optimizations.

Does the VM claim it's network driver was manufactured by Broadcom, or does it go with Cambridge Silicon Radio? Or does it decline to provide a vendor, and if it does, how long until software starts assuming that is the sign of a VM, except this time with potential false positives for users of niche hardware?

Re:Virtual Machine Detection in the Browser (2019) by yjftsjthsd-h on Saturday December 19, 2020 @12:40AM (#25475376)
I think a key distinction is whether we're in an adversarial context or not. And I think loading untrusted applications over network connection from arbitrary third parties is absolutely a position to be distrustful.
Re:Virtual Machine Detection in the Browser (2019) by userbinator on Saturday December 19, 2020 @03:41AM (#25476122)
Does the VM claim it's network driver was manufactured by Broadcom, or does it go with Cambridge Silicon Radio?

It would simply be whatever the virtual NIC is. Intel ones seem to be pretty common, likely due to wide availability of drivers and documentation.

Re:Virtual Machine Detection in the Browser (2019) by elcomet on Saturday December 19, 2020 @02:57AM (#25475907)
It could report the host's hardware.
Re:Virtual Machine Detection in the Browser (2019) by Wowfunhappy on Saturday December 19, 2020 @09:58AM (#25477753)
But now you're leaking information about the host, which I would think is worse given the purpose of a VM.
Re:Virtual Machine Detection in the Browser (2019) by ruslanbogan on Saturday December 19, 2020 @10:35AM (#25477994)
It would have to emulate the host hardware to do that because the fingerprint is only going to report what's listed in Device Manager for instance.
Re:Virtual Machine Detection in the Browser (2019) by tenebrisalietum on Saturday December 19, 2020 @09:40AM (#25477670)
> Ideally, a VM should be indistinguishable from real hardware

VMs wouldn't achieve the performance they do without paravirtualization. VMs don't meticulously emulate all attached virtual devices. Paravirtualized device drivers more or less forward the I/O request to the hypervisor which handles it in a VM-specific way. For example, it's not super useful for a VM to emulate all the bitwise register-twiddling dances needed to talk to a SATA controller, it can simply have some "backdoor" channel into the hypervisor that says "Queue request to write X to LBA Y for this VM".

Since paravirtualization requires specific drivers, it will always be detected.

Re:Virtual Machine Detection in the Browser (2019) by mmwelt on Saturday December 19, 2020 @04:54AM (#25476388)
While changing the reported device names can just make the VM a little less obvious, I suspect there will always be clues that indicate a VM. For example:

- Do network adapter MAC vendor ID's make sense?

- Does the hard drive size make sense?

- Which 3D acceleration features are supported/work correctly?

- How much graphics RAM is there?

- Timing-based methods

It's a bit like detecting private/incognito mode in a browser. Everything worked great, until websites realised there are ways to detect it, then became a game of cat and mouse.

Re:Virtual Machine Detection in the Browser (2019) by gruez on Saturday December 19, 2020 @09:12AM (#25477486)
>- Do network adapter MAC vendor ID's make sense?

>- Does the hard drive size make sense?

not detectable through browser APIs

>- Which 3D acceleration features are supported/work correctly?

vmware workstation has 3d acceleration support targeting directx 11, so I'd imagine most features are supported and are passed through to the host gpu for execution. I doubt you'll able to detect is a vm or not based on that. In addition, resistfingerprinting (on firefox) hides this kind of stuff.

>- How much graphics RAM is there?

vmware workstation has vram selectable from 32MB all the way to 8GB, so that covers the entire range of plausible vram sizes.

>- Timing-based methods

what else can you test that is both accessible via browser api and would yield big differences between a vm and a slow computer?

>It's a bit like detecting private/incognito mode in a browser. Everything worked great, until websites realised there are ways to detect it, then became a game of cat and mouse.

not really, it's a solved problem: make a new browser profile and then delete it after you're done. I've seen a few HN commenters post their (relatively short) scripts to make a new firefox/chromium, start it, and then automatically delete it once it exits.

Re:Virtual Machine Detection in the Browser (2019) by geofft on Friday December 18, 2020 @11:59PM (#25475190)
> Ideally, a VM should be indistinguishable from real hardware

Why? I mean, it's possible to make a VM that's indistinguishable (except for speed), but what's the purpose of doing so?

Most people who run VMs have the purpose of "I want this application to run more conveniently than having dedicated hardware for it." For that purpose, it's useful to provide abstractions (e.g., providing dedicated access to CPUs in a way normal kernels usually don't) and usually to provide sandboxing (e.g., prohibiting disk writes outside of the VM disk), but there's generally little point in lying, unless the software you want to run won't run right without lying. And it's often counterproductive to lie, because software can adapt to the ways the abstraction is leaky if you're truthful about the nature of the abstraction. (In this case, the VMware graphics driver can achieve much better performance by cooperating with the host than a normal graphics driver expecting physical hardware could get on a software emulation of that hardware.)

It's also often pointless to lie - if you pay for a VM from Amazon EC2, and you log into it and it pretends to be a 1U physical server, are you going to believe it?

Re:Virtual Machine Detection in the Browser (2019) by fulafel on Saturday December 19, 2020 @06:41AM (#25476808)
I guess the line of thinking is "the more differences there are, the leakier the abstraction is".

The obvious case people will think about is the security angle (by using a vm you to impersonate a consumer end user, so for eaxmple malware doesn't realize it's running in a vm). But there are other cases where murphy's law will bite you.

For example I bet some WebGL apps manage to trip themselves up over this feature string because of whitelists or buggy logic in code that tries to be clever about used features vs underlying platform.

Re:Virtual Machine Detection in the Browser (2019) by sm4rk0 on Saturday December 19, 2020 @05:54AM (#25476606)
Right question. I'm also missing the "Why" from this article.
Re:Virtual Machine Detection in the Browser (2019) by _trampeltier on Saturday December 19, 2020 @05:01AM (#25476419)
I didn't know WebGL leaks so much information about my machine. I already open a browser just in ingokigno/private mode 90% of the time. Maybe is time to start just each time a different VM for browsing.
Re:Virtual Machine Detection in the Browser (2019) by gruez on Saturday December 19, 2020 @09:14AM (#25477500)
It's not limited to just webgl, there's a whole suite of browser features that can be used to "fingerprint" your browser. see: https://news.ycombinator.com/item?id=25166703
Re:Virtual Machine Detection in the Browser (2019) by jmnicolas on Saturday December 19, 2020 @05:05AM (#25476432)
I tried it, it's highly inconvenient. Maybe QubesOS would help, not sure.
Re:Virtual Machine Detection in the Browser (2019) by gruez on Saturday December 19, 2020 @09:16AM (#25477507)
That wouldn't really help. The containers/VMs might be separated from each other, but they're running on the same hardware/software stack, so they'll behave the same should you decide to fingerprint it.
Re:Virtual Machine Detection in the Browser (2019) by jmnicolas on Saturday December 19, 2020 @10:00AM (#25477768)
I meant for convenience since launching VM is part of the OS.

Wouldn't every Qubes VM (whatever the underlying physical machine) return the same fingerprint? Something like VM Fedora version XXX running on Xen hypervisor.

Re:Virtual Machine Detection in the Browser (2019) by gruez on Saturday December 19, 2020 @02:59PM (#25480646)
Depends how they do 3d rendering. If it's passed through to the host gpu, then it's fingerprintable. If it's using some sort of software renderer that might be fine, but the performance is going to be garbage.
Re:Virtual Machine Detection in the Browser (2019) by bob1029 on Saturday December 19, 2020 @10:38AM (#25478019)
For timing based attacks, couldn't we start looking at injecting random jitter into the JS runtime? You could source the timing entropy from a CSPRNG so that attackers would be unable to distinguish from random noise. Obviously, this would have an impact on performance, but it could be something that is controlled on a per-host basis as required.