-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[proxy] Generate random sec-websocket-key if needed #4801
Conversation
Is this still relevant after the GCp issue seems to be fixed? #4742 (comment) |
/werft run 👍 started the job as gitpod-build-csweichel-proxy-supplement-sec-4742.4 |
Indeed. The GCP issue is gone, but we have no guarantee that it won't come back. |
/werft run 👍 started the job as gitpod-build-csweichel-proxy-supplement-sec-4742.5 |
Most certainly. During the login afaik there's no websocket involvement. |
Looking at Chromium source code, it really surprises me that it worked at all: https://source.chromium.org/chromium/chromium/src/+/main:net/websockets/websocket_basic_handshake_stream.cc;l=508-510;drc=2ac6e19345379fa671bb83a4ff33a498f1dc33c7;bpv=1;bpt=1 Maybe a bug in GCP actually would respond with proper We should also consider another side of injecting such key, spec says that it's to protect from abuse, see https://datatracker.ietf.org/doc/html/rfc6455#section-11.3.1:
|
/werft run 👍 started the job as gitpod-build-csweichel-proxy-supplement-sec-4742.6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code LGTM. I tested regular usage and it worked.
I can, however, not send ws requests without the header in Firefox (not sure how to do so in Chrome).
Plus I'm not 100% convinced that this change is necessary. But I don't see any harm (besides complexity) either.
This PR produces a random sec-websocket-key on the
/api/gitpod
if that header is not present. This has become necessary due to recent Google infrastructure woes.fixes #4742