You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an unrecognized Transfer-Encoding value is received, it is likely because of an attempted request smuggling attack. Thus, the safest action to take whenever such a header is received is to close the connection (and probably also respond with an error status). This is what most HTTP implementations do, including AIOHTTP, Apache httpd, Cheroot, Deno, FastHTTP, Go net/http, Gunicorn, H2O, HAProxy, Hyper, Hypercorn, Jetty, Libsoup, Lighttpd, Mongoose, Nginx, Node.js, Puma, Apache Tomcat, Twisted, Uvicorn, Waitress, WEBrick, and OpenBSD httpd.
The actual behavior
Typically, when Passenger receives a request with an unrecognized Transfer-Encoding header value, it responds 400 and closes the connection, as expected.
However, if that request also has no Host header, then Passenger still sends a 400 response, but doesn't close the connection, and continues parsing requests from after the end of the invalid request's headers.
To reproduce
Install Passenger and Node.
Copy the following script into your filesystem as app.js:
The expected behavior
When an unrecognized
Transfer-Encoding
value is received, it is likely because of an attempted request smuggling attack. Thus, the safest action to take whenever such a header is received is to close the connection (and probably also respond with an error status). This is what most HTTP implementations do, including AIOHTTP, Apache httpd, Cheroot, Deno, FastHTTP, Go net/http, Gunicorn, H2O, HAProxy, Hyper, Hypercorn, Jetty, Libsoup, Lighttpd, Mongoose, Nginx, Node.js, Puma, Apache Tomcat, Twisted, Uvicorn, Waitress, WEBrick, and OpenBSD httpd.The actual behavior
Typically, when Passenger receives a request with an unrecognized
Transfer-Encoding
header value, it responds 400 and closes the connection, as expected.However, if that request also has no
Host
header, then Passenger still sends a 400 response, but doesn't close the connection, and continues parsing requests from after the end of the invalid request's headers.To reproduce
app.js
:passenger start --app-type node --startup-file app.js --engine builtin --port 8000
Transfer-Encoding
value and a validHost
header, followed by a valid pipelined request:Transfer-Encoding
value and noHost
header, followed by a valid pipelined request:Engine
This has been tested only on the builtin engine, and very likely does not work when using the Nginx engine.
Versions
Passenger version:
Phusion Passenger(R) 6.0.23
stable-6.0
branch, commit 1ba2f1b, which is latest at time of writing.OS version: Linux 6.9.7, Debian 13.
Installation method
I have verified that this behavior exists both when using the Debian 12 passenger package, and when building Passenger from source.
Programming language
Containerization
The text was updated successfully, but these errors were encountered: