Bad chunked encoding should cause 400 error, not 503
Expected Behavior
Bad chunked encoding should cause a 400 error.
Current Behavior
The test for VSV16 shows that malformed chunked responses cause a 503 error, which is clearly wrong.
Possible Solution
Varnish should differentiate between “failed to parse data from client” and “failed to fetch response from backend”. It appears that it is the conflation of the two that causes the error.
Steps to Reproduce (for bugs)
Run make -C bin/varnishtest check-TESTS TESTS=tests/f00016.vtc and notice that the tests passes with the 503 status codes.
Context
This is almost certainly quite minor, as only buggy or malicious clients can trigger this code path. Correct clients will not be affected, and setups where Varnish is behind NGINX or HAProxy (as a layer 7 reverse proxy) will not be affected either.
Varnish Cache version
varnishd (varnish-trunk revision 7d6cfa384d7296646e73c80e572fbe182274d701)
Operating system
Fedora 41 with Linux 6.12.25
Source of binary packages used (if any)
None
bugwash agrees.