Reject invalid control frames when building output
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- networking
Research direction
Start at Frame.build() and trace how PingControlMessage.single() and Message.fragment(..., last=False) reach it; compare these paths with the stream parser's control-frame validation. The work is done when oversized or fragmented ping, pong, and close frames are rejected during building, while valid control frames still serialize normally.
Written by the indexing model from the issue text.
Description
Frame.build() validates opcodes and payload lengths, but does not enforce two WebSocket control-frame rules: payloads must be 125 bytes or fewer, and FIN must be set.
For example, PingControlMessage(b"x" * 126).single() emits a 126-byte ping frame. The stream parser rejects a received control frame over 125 bytes, so ws4py can emit a frame that ws4py itself rejects. Message.fragment(..., last=False) can also emit a fragmented ping, pong, or close frame.
Please validate these control-frame constraints in the frame builder so the message helpers cannot serialize invalid control frames.
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 286
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Lawouach/WebSocket-for-Python
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Lawouach/WebSocket-for-Python#300 ·
-
This project is not well maintained so be very very very patient!May be free again @Lawouach claimed this 655 days ago, and no pull request is open. Openquestion
Lawouach/WebSocket-for-Python#297 · 2 comments · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
Lawouach/WebSocket-for-Python#296 ·
-
Make the codes python 3 compatibleMay be free again @auvipy claimed this 1061 days ago, and no pull request is open. Open
Lawouach/WebSocket-for-Python#280 · 1 comment · 1 assignee ·
-
Setup new CIMay be free again @auvipy claimed this 1233 days ago, and no pull request is open. Open
Lawouach/WebSocket-for-Python#275 · 1 assignee ·
All issues in Lawouach/WebSocket-for-Python
Similar issues
-
feature:LinkChecker
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
digitalfabrik/integreat-cms#4594 ·
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
EleutherAI/lm-evaluation-harness#4319 ·
Maintainers usually reply within 1 day
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
json_params_matcher fails on falsy top-level JSON primitives (0, False, "")Possibly taken @mayureshsonawane17 claimed this today. OpenWaiting for: Product Owner
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 5 days