Skip to content

fix(mqtt): close the connection on invalid fixed header flags - #918

Open
56steve wants to merge 1 commit into
ithewei:masterfrom
56steve:fix/mqtt-invalid-fixed-header
Open

56steve wants to merge 1 commit into
ithewei:masterfrom
56steve:fix/mqtt-invalid-fixed-header

Conversation

@56steve

@56steve 56steve commented Oct 28, 2026

Copy link
Copy Markdown

The MQTT client accepted packets with invalid fixed header flags, such as a PUBLISH with QoS 3 or a PUBREC with flags set, and also a Remaining Length encoded in 5 bytes. I added a check on the fixed header flags per packet type and a 4 byte limit on the Remaining Length, and the client now closes the connection in these cases as the MQTT spec requires. I also added a small unit test for the header parsing and flag checks.

Fixes #897

Copilot AI balanced review requested due to automatic review settings October 28, 2026 06:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MQTT client accepts PUBLISH with QoS 3, invalid fixed-header flags and over-long Remaining Length

2 participants