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
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
The request to be rejected with PROTOCOL_ERROR.
In the HTTP/2 spec (RFC9113), it is specified that requests MUST include one valid value for :path pseudo-header field and if the request omits it, the request is considered as malformed (8.3.1).
If the request is malformed, it is specified that it MUST be treated as a stream error of type PROTOCOL_ERROR (8.1.1).
But Node.js does not return an error when the :path header contained #, which makes the :path header invalid.
:path header field consists of absolute-path part and query part (8.3.1).
Neither of them can contain # and thus :path header that contains # is invalid.
absolute-path = 1*( "/" segment )
segment = <segment, see [URI], Section 3.3>
query = <query, see [URI], Section 3.4>
(quoted from RFC9110 4.1)
The request is not rejected and the response "Hello World" is output.
Additional information
I first reported on HackerOne just in case this might be treated as a security bug (SECURITY.md) and was redirected to make a public issue. I found this behavior when fixing GHSA-356w-63v5-8wf4.
curl --request-target "*" --http2-prior-knowledge -v http://localhost:3000 returns PROTOCOL ERROR. But curl --request-target "*" -v http://localhost:3000 does not error when server.mjs is updated to use node:http instead.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Version
22.14.0
Platform
Subsystem
No response
What steps will reproduce the bug?
server.mjs
node server.mjs
curl --request-target /#/ --http2-prior-knowledge -v http://localhost:3000
req.url /#/ /#/
is output and the curl successfully receivesHello World
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
The request to be rejected with
PROTOCOL_ERROR
.In the HTTP/2 spec (RFC9113), it is specified that requests MUST include one valid value for
:path
pseudo-header field and if the request omits it, the request is considered as malformed (8.3.1).If the request is malformed, it is specified that it MUST be treated as a stream error of type
PROTOCOL_ERROR
(8.1.1).But Node.js does not return an error when the
:path
header contained#
, which makes the:path
header invalid.:path
header field consists ofabsolute-path
part andquery
part (8.3.1).Neither of them can contain
#
and thus:path
header that contains#
is invalid.What do you see instead?
The request is not rejected and the response "Hello World" is output.
Additional information
I first reported on HackerOne just in case this might be treated as a security bug (SECURITY.md) and was redirected to make a public issue. I found this behavior when fixing GHSA-356w-63v5-8wf4.
Related behaviors:
#
is not allowed inrequest-target
in HTTP 1. But it only says the server SHOULD respond with 400 or 301.curl --request-target "*" --http2-prior-knowledge -v http://localhost:3000
returns PROTOCOL ERROR. Butcurl --request-target "*" -v http://localhost:3000
does not error whenserver.mjs
is updated to usenode:http
instead.The text was updated successfully, but these errors were encountered: