<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/rss-style.xsl" type="text/xsl"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	     xmlns:dc="http://purl.org/dc/elements/1.1/"
	   xmlns:atom="http://www.w3.org/2005/Atom"
	     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	  xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>vibrate &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/tag/vibrate/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Fri, 10 Jan 2014 11:49:08 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://shkspr.mobi/blog/wp-content/uploads/2023/07/cropped-avatar-32x32.jpeg</url>
	<title>vibrate &#8211; Terence Eden’s Blog</title>
	<link>https://shkspr.mobi/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title><![CDATA[Malicious Use of the HTML5 Vibrate API]]></title>
		<link>https://shkspr.mobi/blog/2014/01/malicious-use-of-the-html5-vibrate-api/</link>
					<comments>https://shkspr.mobi/blog/2014/01/malicious-use-of-the-html5-vibrate-api/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Fri, 10 Jan 2014 11:49:08 +0000</pubDate>
				<category><![CDATA[mobile]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[opera]]></category>
		<category><![CDATA[scam]]></category>
		<category><![CDATA[vibrate]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=9496</guid>

					<description><![CDATA[There is a new API in town!  HTML5 will (soon) let you make the user&#039;s device vibrate.  What fun!  Obviously, it&#039;s useful for triggering alerts, improved immersivness during gameplay, and all sorts of other fun things like sending Morse Code messages via vibration.  At the moment, Chrome (and other Android browsers) ask for permission before accessing features such as geo-location, camera,…]]></description>
										<content:encoded><![CDATA[<p>There is a new API in town!  HTML5 will (soon) let you make the user's device vibrate.  What fun!  Obviously, it's useful for triggering alerts, improved immersivness during gameplay, and all sorts of other fun things like <a href="http://www.smartjava.org/content/html5-remotely-vibrate-phone-morse-code-using-web-sockets-and-vibrate-api">sending Morse Code messages via vibration</a>.</p>

<p>At the moment, Chrome (and other Android browsers) ask for permission before accessing features such as geo-location, camera, address book etc.  This is a security measure to prevent your private information leaving your hands without your knowledge.</p>

<p>At the moment, <a href="http://shapeshed.com/html5-vibrate-api/">accessing the HTML5 Vibrate API</a> doesn't trigger an on-screen warning. Its use is seen as pretty innocuous.  Because, realistically, the worst it can do is prematurely drain your battery. Right?</p>

<p>I'm not so sure.</p>

<h2 id="evil-thoughts"><a href="https://shkspr.mobi/blog/2014/01/malicious-use-of-the-html5-vibrate-api/#evil-thoughts">Evil Thoughts</a></h2>

<p>We've all seen those scummy adverts designed to look like Windows pop-ups.  They usually pose as a legitimate system request - "Update Java" or similar.</p>

<p>Suppose a malicious web page pops up a fake system notification and vibrates at the same time. How confident would you be of telling the difference between a legitimate pop-up and a .png on the web page you're viewing.  After all, the phone buzzed - so it <em>must</em> be genuine.</p>

<p><img src="https://shkspr.mobi/blog/wp-content/uploads/2014/01/Fake-Airdrop.jpg" alt="Fake Airdrop" width="319" height="651" class="aligncenter size-full wp-image-9499">
Are you really receiving an "AirDrop" - or is this page trying to trick you?</p>

<p>Autoplaying sound on adverts in annoying - auto-vibration could be just as irritating.  Imagine searching through tabs until you found the single advert which was pulsing away trying to get you to buy new insurance.</p>

<p>For now, the <strong>intensity</strong> of the vibration cannot be controlled - only the duration.  It is not impossible to conceive of malicious code being able to exploit an unpatched browser flaw and overdrive the motor to destruction.</p>

<h3 id="faking-telephone-calls"><a href="https://shkspr.mobi/blog/2014/01/malicious-use-of-the-html5-vibrate-api/#faking-telephone-calls">Faking Telephone Calls</a></h3>

<p>When combined with HTML5 Audio, it would be possible to create a fairly realistic "Incoming Call" screen which vibrated and played a ringtone.  Once "answered", the page could play some audio which says "Hi, can you call me back urgently - my number is [premium rate line]" and then, perhaps, automatically open up the dialer using the tel: URI.
<a href="https://shkspr.mobi/vibratescam/"><img src="https://shkspr.mobi/blog/wp-content/uploads/2014/01/Phone-call-in-browser-scam-fs8-175x300.png" alt="Phone call in browser scam" width="175" height="300" class="aligncenter size-medium wp-image-9504"></a>
Could you tell if the above was a real phone call? If you looked closely, probably, but when the browser is playing your phone's default ringtone and the handset is vibrating, it would be pretty easy to be confused.  Combine it with a WebRTC call and you're looking at a <em>very</em> convincing scam.</p>

<h2 id="video-demo"><a href="https://shkspr.mobi/blog/2014/01/malicious-use-of-the-html5-vibrate-api/#video-demo">Video Demo</a></h2>

<iframe width="360" height="640" src="//www.youtube.com/embed/VqsRya3ZNoE?feature=player_embedded" frameborder="1" allowfullscreen=""></iframe>

<h2 id="source-code"><a href="https://shkspr.mobi/blog/2014/01/malicious-use-of-the-html5-vibrate-api/#source-code">Source Code</a></h2>

<p>Here's a basic example which you can try on your own phone - <a href="https://shkspr.mobi/vibratescam/">demo site</a>.</p>

<pre><code>&lt;body&gt;
   &lt;script type="text/javascript"&gt;
      navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate;
      navigator.vibrate([1000, 500, 1000, 500, 1000, 500, 1000, 500, 1000, 500, 1000, 500, 1000, 500]);
   &lt;/script&gt;
   &lt;img width="100%" src="phone.png" onclick="window.location.href='tel:09098790815';" /&gt;
   &lt;audio autoplay="autoplay"&gt;
      &lt;source src="ring.mp3" /&gt;
   &lt;/audio&gt;
&lt;/body&gt;
</code></pre>

<p>At the moment, the auto-vibrate and auto-ring only work on Firefox for Android. But no doubt other browsers will follow suite soon.</p>

<h2 id="warnings"><a href="https://shkspr.mobi/blog/2014/01/malicious-use-of-the-html5-vibrate-api/#warnings">Warnings</a></h2>

<p>Firefox was the only browser I found which supported Vibrate - on Android, neither Samsung's browser, Chrome, or Opera did - iPhone also doesn't yet support it.  No one cares about Windows Phone or BlackBerry - so I didn't test them*.</p>

<p>Firefox <strong>doesn't</strong> currently ask for permission when a <a href="http://davidwalsh.name/demo/vibrate.php">page requests access to vibrate</a>.</p>

<p>Do you think browsers should warn before a page vibrates - or is the risk too low?  I guess we'll have to see if the scammers take advantage of it - and whether there is a user backlash.</p>

<p><ins datetime="2014-01-11T14:57:24+00:00">*Update</ins>: thanks to the <a href="http://www.reddit.com/r/programming/comments/1uvlwt/malicious_use_of_the_html5_vibrate_api/">comments on Reddit</a> and on <a href="https://news.ycombinator.com/item?id=7036181">HackerNews</a> it would appear that BB10 <em>does</em> support the vibrate API, Windows Phone doesn't.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=9496&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2014/01/malicious-use-of-the-html5-vibrate-api/feed/</wfw:commentRss>
			<slash:comments>43</slash:comments>
		
		
			</item>
	</channel>
</rss>
