Field notes / Wi-Fi security
Party of Too Many: The Wi-Fi Bug That Forgot to Count
One missing bounds check, one wrong branch, and one very brave canary

A Wi-Fi access point is a very polite piece of hardware. Somebody asks it to do something, and it tries.
Modern Wi-Fi gives connected devices a lot to ask for. One of the newer features lets a client hand the access point a little wishlist. “Set this up for me, and this, and this.” The access point reads the list, answers every item, and sends back a tidy reply.
This post is about a loop that never learned to count.
The vulnerable code sat in the vendor’s own public source, and I’m keeping their name out of this on purpose.
How wireless parsers read packets
Wi-Fi devices run their whole relationship through little messages. “Let me join,” “here’s what I support,” “please set this up for me.” Inside those messages, data is packed into information elements. Each element says what kind of data it carries and how many bytes that data takes up.
Parsers tend to be careful about length, because decades of bugs have trained everyone to be. They’re often a lot less careful about a number hiding one level up. How many elements are on the list? Every item can be perfectly well formed and the whole list can still be too big.
A table that knew its size
The access point kept a small table for recording its verdict on each item. The table was sized to the protocol’s configured maximum. That’s a perfectly reasonable design, as long as everything that touches the table respects it.
Picture a restaurant with a small table. A party walks in and says, “we’re a group.” A careful host asks how many before seating anyone. A careless host just starts dragging chairs over, and the first guest past capacity ends up on the floor next to somebody else’s table. In C, “somebody else’s table” is whatever memory happens to sit next to yours. Turns out arrays don’t come with a bouncer. Noted!
The detail that made me giggle was that the part of the program that sent the reply already respected the maximum. So the program knew exactly how big the table was. It just never told the loop that fills it. Classic group project.
What I could prove offline
I did the follow-up research, built the test harness, and wrote this account. Every test ran offline, on my own machines, with networking switched off. The issue went to the vendor privately long before a word of this was written.
AddressSanitizer caught an out-of-bounds write in the vendor’s own source. The first time it fired, I was genuinely shocked. The patched version passed the same check.
That told me where the defect lived. Whether a shipping access point could be affected over the air was still an open question. My tests never established code execution on a device.
Which branch did the build use?
The vendor fixed the bug. Great! Case closed! Then I looked at what people were actually building.
The fix had landed on one release branch, but real builds were still pulling the code from a different branch that never got it. For a while, the fix existed and the vulnerability was shipping, both at the same time.
A build recipe pointed at the source by branch name instead of a specific commit hash. A branch name is a moving target, like giving someone directions to “wherever Dave parked today.” Whatever sits at the tip on build day is what you get. A fix that never gets copied onto that branch simply never shows up, and nothing complains, because the build still succeeds.
I wrote up the divergence and added it to the existing report so the fix could reach every branch. Now when I hear “is it fixed?” I have a second question. Is it fixed in the thing people actually build?
One very brave canary
With stack protection, the compiler plants a guard value called a canary, as in the coal mine, and checks it before the function returns. In my test, the guard caught the damage and the process stopped. Losing the access-point process still means losing service. RIP canary, you did your job.
Without stack protection, there was no canary to sound the alarm. Watching one bug wear two different severities depending on a single build flag made compiler hardening feel real to me in a way no checklist ever had.
What I’m taking back to my code
- Count the items. A parser needs a limit on the whole collection as well as a length check on each item.
- Fuzz your parsers. Give the collection limit a place in the regression tests.
- Ship with stack protection on. Check which hardening settings made it into the release build.
- Pin dependencies by commit hash. Trace each release back to a revision that contains the fix.
The fix is one line. Everything I actually learned was in the distance between that line and every device that needed it.
