13

Is a system vulnerable where the only untrusted code is interpreted, JIT'd, or executed in a VM as bytecode?

Does it depend on the language? Compiler?

Or, do attacks depend on the attacker loading very specific, compiled instructions onto the machine?


As it's been pointed out, the JavaScript on a web page can theoretically perform an attack.

Is this because V8 and company generate specific machine instructions that can be carefully tailored? Are the vulnerabilities in the JITing? The VM's? Or can any Turing-complete language mount an attack? ... Where's the line?

  • I would love to see an implementation of Spectre written in Malbolge. – Mark Jan 5 '18 at 0:58
13

No, interpreted or JIT'd code is also vulnerable

According to multiple sources, the attack can be exploited via JavaScript in browsers. An excerpt from the Windows Blogs on Microsoft:

Today, Google Project Zero published details of a class of vulnerabilities which can be exploited by speculative execution side-channel attacks. These techniques can be used via JavaScript code running in the browser, which may allow attackers to gain access to memory in the attacker’s process.

From Chromium Security:

This research has implications for products and services that execute externally supplied code, including Chrome and other browsers with support for JavaScript and WebAssembly.

And from the Mozilla Security Blog:

Our internal experiments confirm that it is possible to use similar techniques from Web content to read private information between different origins. The full extent of this class of attack is still under investigation and we are working with security researchers and other browser vendors to fully understand the threat and fixes.

These days, JavaScript is quite advanced with the advent of things like Node.js and WebAssembly, and can arguably be considered lower level than it was in previous years.

The three aforementioned browser vendors have taken precautions against the vulnerability:

  • 1
    Is there something about the way browser compile code that enable this? I.e., can an attack be mounted because V8 and company all generate a very particular set of machine instructions? Or, can any Turing-complete language be used to mount an attack? ... where's the line? ... (OP is updated to reflect that question clarification.) – svidgen Jan 4 '18 at 19:05
  • 1
    JIT'd Javascript is vulnerable, but I haven't seen anything to indicate that fully-interpreted Javascript is. – Mark Jan 4 '18 at 19:16
  • 2
    Timing for interpreted (not JIT) languages is probably not high-resolution enough to time cache misses/branch mispredictions. Any language & implementation that allows high-resolution timing should allow some variant of these attacks. – David Jan 5 '18 at 0:37
  • The resolution reduction patches for browsers etc. were obsolete before they were introduced: one team just spawned a second thread doing the equivalent of volatile uint64_t i; while (true) ++i; for counting. – mirabilos Jan 5 '18 at 17:44
  • Re your last paragraph: Is there an equivalent link/bullet for Safari just yet? – Drux Jan 8 '18 at 21:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.