Wardle discovered this flaw while he was trying to copy and paste a code.
“I was just kind of goofing around with this feature. I copied and pasted the code for a synthetic mouse down twice accidentally – forgetting to change a value of a flag that would indicate a mouse “up” event. Without realizing my ‘mistake,’ I compiled and ran the code, and honestly was rather surprised when it generated an allowed synthetic click!”After the possibility of synthetic mouse-click attacks was made known, Apple patched the flaw by adding security prompts in UI. Macs now ask permission from the users prior allowing any apps to run. This way, Macs prevent malware and malicious apps to run automatically on the system and that is where the vulnerability lies too.
While synthetic clicks are allowed by Mac OS for some programs such as AppleScript, Wardle told that Mac OS also allows synthetic clicks on prompts seeking permission to access calendar, contacts, location recording, and network identification. It is because of the vulnerability in Mac OS that reads two consecutive mouse “down” events as a manual approval with a “down” and “up”.
“For some unknown reason the two synthetic mouse ‘down’ events confuse the system and the OS sees it as a legitimate click. This fully breaks a foundational security mechanism of High Sierra.”
“Armed with the bug, it was trivial to programmatically bypass Apple's touted 'User-Approved Kext' security feature, dump all passwords from the keychain, bypass 3rd-party security tools, and much more! And as Apple's patch was incomplete (surprise surprise) we'll drop a 0day that (still) allows unprivileged code to post synthetic events and bypass various security mechanisms on a fully patched macOS box.”Considering the dangers associated with this trivial yet harmful bug, Wardle states that Apple will entirely ditch the flawed feature. The upcoming version of Mac OS ‘Mojave’ will block all synthetic events. Although it will cause a problem for the legitimate apps, and added burden on the users with frequent security prompts. However, it may certainly help to alleviate such vulnerabilities welcoming malware attacks.
Let us know your thoughts in the comments section.