A static file answered with gzip has an empty body while Coraza is on (sendfile on) #2
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Keel-Linux/libnginx-mod-http-coraza#2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found by step 7 of handbook decision 0041 (Keel-Linux/keel-web#1), on the Keel Web image with libnginx-mod-http-coraza 0.21.0-0keel1 and trixie's nginx 1.26.3, Debian's
nginx.confunchanged (sendfile on,gzip on).With the module loaded and
coraza on, a static file answered with gzip has an empty body: 200,Content-Encoding: gzip, 20 bytes, which gunzip to nothing. WithoutAccept-Encoding: gzipthe same request gets the whole file, and withsendfile offin the server the gzip answer is whole again (423 bytes for a 625 byte page). With the module not loaded the gzip answer is whole.Browsers always send
Accept-Encoding: gzip, so every static page of a server where Coraza is on comes back blank. The probable cause is the delayed response headers of the body filter (headers_delayed): the file-backed buffer is held while gzip's header filter has not run yet, so nothing has asked for the body in memory, and gzip later gets a buffer with no bytes in memory. The test set probably wants a case withsendfile onandgzip onover a static file.keel-web works around it on its one internal hop (
gzip offonunix:/run/nginx/keel-app.sock, which only Anubis reads); any other server with Coraza on keeps the bug.