Skip to content

Fix panic on malformed Dot11 InformationElement packets#1232

Open
mohammadmseet-hue wants to merge 1 commit intogoogle:masterfrom
mohammadmseet-hue:fix-dot11-panic
Open

Fix panic on malformed Dot11 InformationElement packets#1232
mohammadmseet-hue wants to merge 1 commit intogoogle:masterfrom
mohammadmseet-hue:fix-dot11-panic

Conversation

@mohammadmseet-hue
Copy link
Copy Markdown

Summary

Fix bounds checking for vendor IEs (ID=221) in Dot11InformationElement.DecodeFromBytes.

Root cause: For vendor IEs, the code reads data[offset+4:offset+int(m.Length)] to extract Info after the 4-byte OUI. When m.Length < 4, this creates an invalid slice with a negative length, causing a panic. The previous len(data) < offset+4 check was also incorrectly applied to all IE types, not just vendor extensions.

Fix: Move the length check inside the vendor IE branch and validate m.Length >= 4 before splitting OUI from Info.

All existing tests pass.

For vendor IEs (ID=221), check m.Length >= 4 before reading OUI and
splitting data. The previous bounds check was applied to all IE types
regardless of vendor status, and did not prevent a panic when a vendor
IE had Length < 4.
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.

1 participant