The attack, published in the International Journal of Information Security, wouldn't be possible if it weren't for a convenient API to motion sensors.
By the third attempt, Mehrnezhad's “PINlogger.js” script is correctly guessing 94 percent of PINs.
As he explains in the Newcastle University media release, “mobile apps and websites don’t need to ask permission to access most of them, malicious programs can covertly ‘listen in’ on your sensor data and use it to discover a wide range of sensitive information about you such as phone call timing, physical activities and even your touch actions, PINs and passwords”.
If a user was tricked into loading the PIN-logger into one tab of a browser, and ran a banking app in another tab, Mehrnezhad reckons the script can also snoop on their bank logins.
The paper explains that vendors probably didn't think in-browser access to motion sensors would be so revealing because of their low sampling rates.
Mehrnezhad's team had already identified single digits from smartphone sensors, including “click, scroll, and zoom and even the numpad’s digits”. With PINlogger.js, the group extends their work to capturing 4-digit sequences.
“W3C specifications do not specify any policy and do not discuss any risks associated with this potential vulnerability,” the paper notes.
The Register has previously noted the W3C's aggressive attitude to exposing new and intrusive interfaces to Websites. Privacy researcher Lukasz Olejnik has highlighted potentially harmful Web APIs for battery charge and Bluetooth devices.
Mehrnezhad doesn't call for review or removal of the APIs, but says browser providers haven't yet come up with a solution. ®
Update: Apple didn't make any noise about it, but it's blocked this issue in its latest round of security updates. It now bars access to sensor information unless the Web view is active. ®