Bypassing security prompts in High Sierra is still possible with synthetic clicks thanks to a bug triggered by just two lines of code. High Sierra confuses a sequence of two synthetic mouse down events for a human-generated action. For some reason, the operating system translates the programmatic clicks into a mouse “up”” and mouse “”down”” command. Apple released a patch for the mouse keys hack
Source: things will change in Mojave as the next version of Mojave will block all synthetic events.”

