Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from websockets:master #2

Open
wants to merge 117 commits into
base: master
Choose a base branch
from
Open

Conversation

pull[bot]
Copy link

@pull pull bot commented May 26, 2022

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

Drop the `Authorization` and `Cookie` headers if the original request
for the opening handshake is sent over HTTPS and the client is
redirected to the same host over plain HTTP (wss: to ws:).

If an HTTPS server redirects to same host over plain HTTP, the problem
is on the server, but handling this condition is not hard and reduces
the risk of leaking credentials due to MITM issues.

Refs: 6946f5fe
Add the ability to inspect the invalid handshake requests and respond
to them with a custom HTTP response.

Closes #2045
@pull pull bot added ⤵️ pull merge-conflict Resolve conflicts manually labels May 26, 2022
lpinca and others added 9 commits May 30, 2022 17:32
When set to non empty values, the `WS_NO_BUFFER_UTIL` and
`WS_NO_UTF_8_VALIDATE` environment variables, prevent the optional
`bufferutil` and `utf-8-validate` dependencies  from being required,
respectively.

These might be useful to enhance security in systems where a user can
put a package in the package search path of an application of another
user, due to how the Node.js resolver algorithm works.
Ensure that the `Connection`, `Sec-WebSocket-Key`,
`Sec-WebSocket-Version`, and `Upgrade` headers are not overridden.

Refs: #2048 (comment)
Drop the `Authorization` and `Cookie` headers if the original request
for the opening handshake is sent to an IPC server and the client is
redirected to a TCP server (ws+unix: to ws: or wss:), and vice versa
(ws: or wss: to ws+unix).

Also drop the `Authorization` and `Cookie` headers if the original
request for the opening handshake is sent to an IPC server and the
client is redirected to another IPC server.

Refs: 6946f5fe
DLiblik and others added 8 commits September 18, 2022 20:48
Add reference to Node.js's own related documentation about the
constraints on `Object` values.

Fixes #2076
Remove the two forward slashes after the scheme. The URL is parsed in
the same way and it is easier to grok.
Rename the `invalidURLMessage` variable to `invalidUrlMessage`.
Document how to connect to a named pipe endpoint and the limitations.

Refs: #1808
Refs: #2075
Use a pool of random bytes to reduce the amount of
`crypto.randomFillSync()` calls.

Refs: nodejs/undici#3204
It is possible that the Upgrade header is correctly received and handled
(the `'upgrade'` event is emitted) without its value being returned to
the user. This can happen if the number of received headers exceed the
`server.maxHeadersCount` or `request.maxHeadersCount` threshold. In this
case `incomingMessage.headers.upgrade` may not be set.

Handle the case correctly and abort the handshake.

Fixes #2230
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⤵️ pull merge-conflict Resolve conflicts manually
Projects
None yet