litespeedtech / litespeedtech/openlitespeed
LiteSpeed ignores requests pipelined after requests with chunked message bodies
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.5k
- Forks
- 233
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 5
Description
When LiteSpeed receives a pipeline in which the first request is chunked, the rest of the requests in the pipeline are ignored, but the connection is not closed, and further requests will be processed in a short period of time.
This can be demonstrated by running the following command on a server running LiteSpeed on port 80:
(
printf 'POST /a HTTP/1.1\r\nHost: whatever\r\nTransfer-Encoding: chunked\r\n\r\n0\r\n\r\nGET /b HTTP/1.1\r\nHost: whatever\r\n\r\n'
sleep 1
printf 'DELETE /c HTTP/1.1\r\nHost: whatever\r\n\r\n'
) | nc localhost 80
You should see the server respond to the POST and the DELETE request, but not the GET (presumably due to the sleep).
I have tested this on LiteSpeed 1.8.1 by using a simple application that echos received request methods. You can reproduce my setup exactly using the Dockerfile here.
This is the output of the above command inside of the resulting Docker container:
HTTP/1.1 200 OK
content-type: text/html; charset=UTF-8
content-length: 141
date: Tue, 09 Jul 2024 20:23:49 GMT
server: LiteSpeed
connection: Keep-Alive
{"headers":[["SG9zdA==","d2hhdGV2ZXI="],["Q29udGVudC1MZW5ndGg=","MA=="]],"body":"","method":"UE9TVA==","uri":"L2E=","version":"SFRUUC8xLjE="}HTTP/1.1 200 OK
content-type: text/html; charset=UTF-8
content-length: 109
date: Tue, 09 Jul 2024 20:23:50 GMT
server: LiteSpeed
connection: Keep-Alive
{"headers":[["SG9zdA==","d2hhdGV2ZXI="]],"body":"","method":"REVMRVRF","uri":"L2M=","version":"SFRUUC8xLjE="}
Base64-decoding the method fields in the above JSON objects shows that only the POST and DELETE were responded to.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the behavior with the provided nc pipeline and the linked Dockerfile for the LiteSpeed setup. Trace HTTP/1.1 pipelining around the chunked POST and verify that the server processes the queued GET before the later DELETE. Done means all three requests receive responses without the current delay-dependent omission.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100