-
Notifications
You must be signed in to change notification settings - Fork 3.6k
enh: add disableClientMask option for WebSocket payload masking and optimize mask calculation #985
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
base: main
Are you sure you want to change the base?
Conversation
Masking prevents a client application from sending a specific stream of bytes to a server. TLS does not eliminate the need for this feature. See Attacks On Infrastructure for more information. |
I believe TLS can prevent data interception and tampering, making the protocol's built-in masking mechanism redundant under TLS protection. |
The purpose of masking is to prevent a client application running in a browser from controlling the sequence of bytes sent to a server. Masking is useless for preventing data interception or tampering. If the feature is added, the feature should be enabled with a Dialer field. There are two reasons for this:
To keep the connection method as in the current PR, OP should give a use case for turning the flag on and off. Also, OP should given a justification for not adding the setting with other client specific settings in Dialer. |
I didn't modify the protocol itself, but mathematically bypassed the masking computation. This serves as a performance optimization in specific scenarios, with precise control through parameters. |
// by generating zero-value mask keys ([4]byte{0,0,0,0}), effectively omitting XOR operations | ||
// while maintaining formal protocol compliance. | ||
// | ||
// Security Advisory: |
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.
What type of PR is this? (check all applicable)
Description
Optimized WebSocket masking by:
Related Tickets & Documents
Added/updated tests?
have not been included
Run verifications and test
make verify
is passingmake test
is passing