Menu

React, etc. Tech Stack

React, Flux, GraphQL, Hack, HHVM...? All of this and more!

Meltdown/Spectre JavaScript Exploit Example Code

Here is an example of an exploit of the Meltdown and Spectre vulnerabilities with JavaScript. The source is the Spectre whitepaper on exploiting Speculative Execution in modern CPUs.

var TABLE1_STRIDE = 1; var TABLE1_BYTES = 3; var probeTable = ['alpha', 'beta', 'corky']; var simpleByteArray = [0x00, 0x01, 0x02]; var localJunk; var index = 0; if (index < simpleByteArray.length) { index = simpleByteArray[index | 0]; index = (((index * TABLE1_STRIDE) | 0) & (TABLE1_BYTES - 1)) | 0; localJunk &= probeTable[index | 0] | 0; } console.log(localJunk);

Written by Jorgé on Wednesday January 3, 2018

Permalink -

« JavaScript Spectre/Meltdown FAQ - Best Node.js alternatives to WordPress in 2018 »