| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
The masked-payload branch incorrectly used range(data_to_append) on bytes and attempted in-place XOR on an immutable bytes object. Unmasking now uses a bytearray per RFC 6455. Added a short comment that SHA-1 in Sec-WebSocket-Accept is required by RFC 6455 section 1.3. Made-with: Cursor
|
Thanks for the contribution! Before we can merge this, we need @beejak to sign the Salesforce Inc. Contributor License Agreement. |
Sorry, something went wrong.
There was a problem hiding this comment.
Hi @beejak thanks for your interest and contribution 💯
There seems to be other improvement that could be made in this area before we can merge this
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
This change fixes the masked WebSocket frame handling path in the builtin Socket Mode client (slack_sdk/socket_mode/builtin/internals.py).
The previous code used range(data_to_append) where data_to_append is bytes (invalid in Python 3) and attempted in-place XOR on an immutable bytes object. Per RFC 6455, masking XORs octets; unmasking is now implemented with a bytearray and range(len(...)).
A short comment was also added in _validate_sec_websocket_accept: SHA-1 for Sec-WebSocket-Accept is required by RFC 6455 section 1.3, not a discretionary hash upgrade to SHA-256.
Verification
(2 passed locally.)
Context
Servers normally send unmasked frames to clients; the masked branch is uncommon but should be correct for compliance and tests that exercise masked server frames.