layout: col-sidebar title: HTTP/2 Reset Attack author: Vaibhav Malik tags: [attacks, application, web] permalink: /attacks/HTTP2_Reset_Attack
HTTP/2 is an iteration of the HTTP protocol, designed to improve performance and security compared to HTTP/1.1. However, a vulnerability in the HTTP/2 protocol, known as the “Rapid Reset Vulnerability”, was discovered that could allow an attacker to terminate connections and prevent assets from loading.
In an HTTP/2 Reset Attack, the attacker sends a crafted RST_STREAM frame to abruptly terminate an established stream. If this RST_STREAM frame is sent before the client receives the complete response from the server, the browser will discard the partial response and will not render or execute any further data on that stream. This can lead to pages failing to load completely, or specific resources like images, stylesheets, or scripts being blocked.
The attack is possible because HTTP/2 allows a client or a server to terminate a stream at any time by sending an RST_STREAM frame with an error code. The protocol does not require any verification of whether the sender is authorized to close the stream. An attacker can exploit this by sending a forged RST_STREAM frame, pretending to be the server.
Suppose a web page includes a critical JavaScript file:
<script src="/core.js"></script>
An attacker who can monitor the network traffic (e.g., on an public
Wi-Fi network) can observe when the browser requests /core.js
.
Before the server can complete sending the response, the attacker
sends a forged RST_STREAM frame with an error code (e.g., REFUSED_STREAM).
RST_STREAM
Stream ID: 5
Error Code: REFUSED_STREAM (0x7)
Upon receiving this frame, the browser will abort the stream and
will not process any further data received on that stream. As a
result, the core.js
file will not be loaded, potentially breaking the functionality of the page.
The HTTP/2 Reset Attack can lead to:
There are several ways to mitigate HTTP/2 Reset Attacks:
Ultimately, the HTTP/2 specification needs to be updated to address this vulnerability. Work is underway to amend the spec and provide clear guidance to implementers.