Firefox crashed when encounter immature HTTP/2 server send DATA frame padding length large than payload length
A test HTTP/2 server sent a DATA frame whose declared padding length exceeded the actual payload, and Firefox crashed instead of rejecting the frame. An attacker running a malicious or buggy HTTP/2 server could crash a visiting browser.
- Fixed in 20 days
- Paid in 30 days
- Disclosed after 20 days
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
Steps to reproduce:
We had a test tool that focus on HTTP/2 client/browser testing.
You could reference https://github.com/summerwind/h2spec/pull/74#issuecomment-283273210
Long story short, when the server send a DATA frame defined padding length=6, but only had 5 bytes in payload(including padding length byte). Firefox would crash.
Steps to reproduce:
1. mkdir src
2. export GOPATH=path to the folder created at step.1
3. mkdir -p src/github.com/summerwind
4. cd src/github.com/summerwind
5. git clone https://github.com/chhsiao90/h2spec.git
6. git checkout h2specd
7. go run cmd/h2spec/h2specd.go -t -p 8080 -c server.crt -k server.key -v
8. open firefox to http://localhost:8080
9. find the third link under 6.1. DATA marked with desc: Sends a DATA frame with invalid pad length
Actual results:
Firefox crashed
Expected results:
Marked the http2 connection as connection error, send GOAWAY frame and close the connection
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the HTTP/2 frame parser did not validate that the declared padding length fits within the received payload before using it.
Impact
A malicious or faulty HTTP/2 server could crash the Firefox browser of anyone connecting to it.
What the attacker needed
Victim connects to a malicious HTTP/2 server
How it was found
- Set up a Go workspace and clone the modified h2spec test server
- Check out the branch containing the test server
- Run the test server on a local port with a certificate and key
- Open Firefox to the local test page
- Select the test case that sends a DATA frame with an invalid pad length
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
HTTP/2 is a newer version of the protocol browsers use to talk to websites. Each chunk of data a server sends carries a small header saying how much padding (filler bytes) follows; here the server claimed more filler than it actually sent. Firefox trusted that number and crashed rather than treating it as a broken connection.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.