“The bug also affects macOS and iOS when Bluetooth is enabled and a Magic Keyboard has been paired with the vulnerable phone or computer.”
Everybody at the Apple Store thought it was weird when they had to open up my various iMac boxes (over the years) to pull out the wireless keyboard and replace it with a wired one. I’ve never once regretted it.
Unfortunately those days are gone. BT sucks.