<?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[SourceClear - Medium]]></title>
        <description><![CDATA[SourceClear is a continuous security platform that gives you visibility and control over the open source code you are using. Security and dev teams can collaborate to remediate security and compliance issues — giving you the confidence to ship secure software fast. - Medium]]></description>
        <link>https://medium.com/sourceclear?source=rss----7d9d7ea9d0ee---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>SourceClear - Medium</title>
            <link>https://medium.com/sourceclear?source=rss----7d9d7ea9d0ee---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 07:32:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/sourceclear" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[After The Equifax Hack We Examined the Latest Apache Struts Code]]></title>
            <link>https://medium.com/sourceclear/after-the-equifax-hack-we-examined-the-latest-apache-struts-code-80c29893b155?source=rss----7d9d7ea9d0ee---4</link>
            <guid isPermaLink="false">https://medium.com/p/80c29893b155</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[equifax]]></category>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[thought-leadership]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Vanessa Henderson]]></dc:creator>
            <pubDate>Wed, 27 Sep 2017 17:24:26 GMT</pubDate>
            <atom:updated>2017-09-27T17:27:00.590Z</atom:updated>
            <content:encoded><![CDATA[<p>In light of the recent news that the Equifax hack was a result of an old version of Apache Struts being exploited, we analyzed the latest code from Apache Struts with SourceClear. The code we analyzed can be found at <a href="https://github.com/apache/struts">https://github.com/apache/struts</a>. At the time of analysis the code was last updated on Sept 6th at 11:28 am in this <a href="https://github.com/apache/struts/commit/bca42a2091588117c1df6e365b24cca00be4c417">commit</a>, updating the pom.xml file to upgrade the Log4J library.</p><p>We scanned the code using the latest version of the SourceClear agent (2.10.29) on a Macbook using the simple command</p><p>./srcclr scan --url <a href="https://github.com/apache/struts">https://github.com/apache/struts</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/0*drMkbN0UTvHl94uO.png" /></figure><p>The results show that project declares 75 direct libraries in its source code but adds an additional 117 libraries when it is built, making a total of 151 libraries being used when the code is built. This is less than the typical 1 in 4 ratio we see for Java projects. The screenshot below is a sunburst chart of the dependencies which is simpler than most Java applications we see and radically simpler than many JavaScript applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/0*micRkkPRrafLdQNF.png" /></figure><p>Of those 75 libraries declared by the developers, 40 of them are not using the latest version of those libraries (as defined by <a href="http://semver.org/">semver</a>) and of the 151 libraries used by the project after being built 100 are not using the latest version (as defined by <a href="http://semver.org/">semver</a>).</p><p>95.3% of the code comes from open-source libraries that the Struts framework itself is using. Despite the project specifying the Apache license, the open source libraries themselves use 12 different types of open-source licenses.</p><p>11 of the libraries have 43 vulnerabilities reported in the versions currently being used. Of those 43 vulnerabilities there are 2 High Risk CVE’s, 31 Medium Risk vulnerabilities with CVE’s and 3 Low Risk Vulnerabilities with CVE’s. There are also 3 High Risk vulnerabilities with Reserved CVE’s where information is not widely known as well as 3 Medium Risk and 1 Low Risk vulnerability with no CVE.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/0*nQXgz0cipzfWGrSj.png" /></figure><p>This is where is gets interesting. At SourceClear we build a complete dependency graph and a call-graph so we can trace a project’s use of the vulnerable methods in vulnerable libraries whether declared in the source-code or in a library pulled in at build time. We know from experience that if you simply grep through build files you typically miss between 75% and 90% of the <a href="https://www.sourceclear.com/blog/A-look-at-Vulnerabilities-and-Dependencies-by-Language/">open-source libraries being used</a> and that 90% of vulnerable libraries are not actually used in a vulnerable way. Analyzing code at build time using both a dependency graph and call-graph is the only way to do an accurate assessment and determine correct results.</p><p>In this particular case that analysis shows that the JasperReports library (that itself has been subject of several CVE’s) pulls in the Jackson-databind library 2.1.4 that is currently subject to a high risk reserved CVE. While there are <a href="https://nvd.nist.gov/vuln/detail/CVE-2017-7525">no details available</a> on the National Vulnerability Data, our researchers run technology that parses upstream commit logs and other public sources and we know that this is a remote code execution vulnerability. That data is actually public at <a href="https://access.redhat.com/security/cve/cve-2017-7525">RedHat</a> who are a CVE numbering authority. In this particular case we have examined the call chain and don’t believe that this is exploitable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/0*A-u2-3PH5blZachA.png" /></figure><p>We were interested to see how many other libraries use the vulnerable version of Jackson-databind so used our recently announced <a href="https://www.sourceclear.com/sgl/">SGL technology</a>.</p><p>vulnerability(identity: &quot;2017-7525&quot;) has_version_range has_library union(dependent_on*, embedded_in*)</p><p>Using the query above we see that 10,566 other versions of other libraries are directly and indirectly affected by this vulnerability.</p><h3>Summary</h3><p>The current version of Struts at the time of analysis uses 11 libraries that have 43 vulnerabilities. One of those libraries jackson-databind was itself not specified by the developers but was added outside of their control by a library they did chose to use. That library has a remote code execution issue. This issue has been reported but is currently marked as a reserved CVE with limited information available. SGL shows that over 10,000 other versions of other libraries also use the vulnerable jackson-databind library. This type of analysis can be done by performing build-time analysis and identifying the vulnerable version of the Jackson-databind library would have been missed by simple tools that only parse code in Git repos and match results against CVE’s.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80c29893b155" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sourceclear/after-the-equifax-hack-we-examined-the-latest-apache-struts-code-80c29893b155">After The Equifax Hack We Examined the Latest Apache Struts Code</a> was originally published in <a href="https://medium.com/sourceclear">SourceClear</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing PHP Language Support]]></title>
            <link>https://medium.com/sourceclear/announcing-php-language-support-5d344f00b751?source=rss----7d9d7ea9d0ee---4</link>
            <guid isPermaLink="false">https://medium.com/p/5d344f00b751</guid>
            <category><![CDATA[product]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Vanessa Henderson]]></dc:creator>
            <pubDate>Mon, 25 Sep 2017 20:26:44 GMT</pubDate>
            <atom:updated>2017-09-25T20:26:43.674Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JGkOiiDXtsuXgq4koo5uJw.png" /></figure><p>We are proud to announce that we are adding language support for PHP. You can now scan your PHP projects and identify vulnerable libraries. We currently support the Composer package manager.</p><h3>Scanning a PHP Project</h3><h4>Prerequisites</h4><p>The SourceClear Agent must be already installed and activated. If this is your first scan please <a href="https://www.sourceclear.com/docs/quick-start-guide/get-to-first-scan/">click here</a> to get started. We currently support the Composer package manager. Make sure it’s installed and your development environment is configured accordingly. <a href="https://getcomposer.org/doc/00-intro.md">Click here</a> to get more details on installing Composer and PHP.</p><h4>Scanning an example project</h4><p>You can scan your own PHP project or the example project provided below. To scan the example project open your terminal and type the following:</p><pre>$ git clone git@github.com:srcclr/example-php-composer<br>$ cd example-php-composer<br>$ srcclr scan .</pre><h4>Scanning your project</h4><p>To scan your own project, open a terminal and type the following:</p><pre>$ cd /my/project/directory (your project directory)<br>$ srcclr scan .</pre><h4>Access your results</h4><p>Once the scan finishes, you should see an output similar to this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vxP2YxGFBaG1y8N8.png" /></figure><p>Access the scan report by copying the link right to “Full Report Details” and pasting into your browser. This will take you to SourceClear where you can access the scan results and additional insights about your projects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hM9jmF3jIXf2Me2U.png" /></figure><p><a href="https://www.sourceclear.com/docs/quick-start-guide/scan-report-features/">Click here</a> to learn more about SourceClear project reports.</p><p>This new functionality will help you and your team ship more secure PHP applications. As always, we’re here to help. <a href="https://www.sourceclear.com/contact-us/">Contact us</a>, or email our helpful <a href="mailto:support@sourceclear.com">support team</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d344f00b751" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sourceclear/announcing-php-language-support-5d344f00b751">Announcing PHP Language Support</a> was originally published in <a href="https://medium.com/sourceclear">SourceClear</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Equifax Hack: What all companies need to know and do to prevent it from happening to them]]></title>
            <link>https://medium.com/sourceclear/the-equifax-hack-what-all-companies-need-to-know-and-do-to-prevent-it-from-happening-to-them-d8b62a8e7204?source=rss----7d9d7ea9d0ee---4</link>
            <guid isPermaLink="false">https://medium.com/p/d8b62a8e7204</guid>
            <category><![CDATA[data-breach]]></category>
            <category><![CDATA[equifax]]></category>
            <category><![CDATA[thought-leadership]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[vulnerability]]></category>
            <dc:creator><![CDATA[Vanessa Henderson]]></dc:creator>
            <pubDate>Mon, 18 Sep 2017 18:25:34 GMT</pubDate>
            <atom:updated>2017-09-27T22:57:23.940Z</atom:updated>
            <content:encoded><![CDATA[<p>The Facts — On September 7th Equifax announced that hackers breached their systems. According to their <a href="https://www.equifaxsecurity2017.com/">information site</a> the breach occurred in mid-May and became known to Equifax on July 29th. In the days following the announcement, <a href="https://baird.bluematrix.com/docs/pdf/dbf801ef-f20e-4d6f-91c1-88e55503ecb0.pdf">Equifax’s stock fell over 13%</a>, a congressional hearing was ordered and a class-action lawsuit formed for the people affected. Fortune describes the hack as “…the most economically damaging hack in U.S. history”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/1*Wx_jjsq2xxsE1rIXducoVA.png" /></figure><p>The full story and the long term impact are still emerging but given the magnitude of this hack and the details that are already known, we have put together a set of free resources to help you make sure your company does not become the next Equifax.</p><h3>How the Equifax Data Breach Happened</h3><p>In this particular case hackers exploited a web vulnerability in the Equifax site which was built on a Java framework called Apache Struts. Struts is widely used in banks, airlines, and Fortune 1000 companies and like almost all popular open-source code has had its fair share of vulnerabilities being reported which have subsequently been patched. This year there have been several major vulnerabilities reported in Struts: the first in March and the most recent last week. SourceClear also knows that most vulnerabilities are not reported to the National Vulnerability Database (NVD) and Struts, like other open-source projects are likely to contain many inherited and similar issues.</p><h3>Analyzing the Latest Code for Apache Struts</h3><p>We analyzed the <a href="https://github.com/apache/struts">latest code for Struts</a> on Sunday 10th September which revealed it uses 11 vulnerable libraries which have 43 security advisories reported against them. One specific library has a high risk remote code execution vulnerability where the vulnerable part is actively being called. Information about this issue <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-7525">CVE-2017–7525</a> at the time of writing is marked as Reserved in the NVD meaning it is not publicly or widely available but SourceClear has a complete technical writeup available to its users. This new issue is a textbook case of why simplistic tools that only look at the source code are not sufficient for open-source security testing because the library in question is only added to Struts at build-time and would therefore never be seen by tools monitoring code repos like GitHub. The full write up of our analysis of the open-source used in the latest version of Struts can be found <a href="https://www.sourceclear.com/blog/After-The-Equifax-Hack-We-Examined-the-Latest-Apache-Struts-Code/">here</a>.</p><p>Data breaches like this are a result of hackers exploiting vulnerable open-source code are becoming the new normal. There are effective tools and processes you can adopt today to prevent it from happening to you.</p><h3>What You Should Do</h3><p>All companies can take immediate steps to determine if their projects are using the vulnerable versions of Apache Struts and then determine if they themselves are vulnerable. You can immediately sign up for a <a href="https://app.sourceclear.io/signup">30 day free trial of SourceClear here</a> which will give your company unlimited access to scan all of your code.</p><p>Scanning with SourceClear will show you what open-source is being used, which vulnerable libraries are being used, and most importantly if you are using them in a way that makes your company vulnerable. Our real-world studies show that less than 10% of the time that vulnerable Java libraries are used that the project is actually vulnerable and the only way to actually determine this is to scan your projects when they are being compiled. SourceClear is the only solution that uses call-graph technology to perform this level of analysis.</p><p>Longer term all companies should build an open-source security program which scans always all code as part of the continuous integration process and ensures that only safe-code is being consumed by their software supply chain. SourceClear is a security automation and risk management solution for open-source code that integrates with all continuous integration systems and connects with issues trackers like Atlassian’s JIRA to allow security teams and development teams to work together, keeping safe open-source in and kicking un-safe open-source out.</p><p>We are offering a free 30 minute private consultation for companies that think they might be vulnerable and want expert help to understand the issue further and how to address it. You can register for a free consultation <a href="https://www.sourceclear.com/equifax-vulnerability/">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8b62a8e7204" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sourceclear/the-equifax-hack-what-all-companies-need-to-know-and-do-to-prevent-it-from-happening-to-them-d8b62a8e7204">The Equifax Hack: What all companies need to know and do to prevent it from happening to them</a> was originally published in <a href="https://medium.com/sourceclear">SourceClear</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SGL: Mapping the open-source genome for fun and profit]]></title>
            <link>https://medium.com/sourceclear/sgl-mapping-the-open-source-genome-for-fun-and-profit-40eaeb7c22ce?source=rss----7d9d7ea9d0ee---4</link>
            <guid isPermaLink="false">https://medium.com/p/40eaeb7c22ce</guid>
            <category><![CDATA[code-analysis]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[research-and-development]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[security-graph-language]]></category>
            <dc:creator><![CDATA[Vanessa Henderson]]></dc:creator>
            <pubDate>Wed, 13 Sep 2017 12:23:07 GMT</pubDate>
            <atom:updated>2017-09-13T12:23:06.905Z</atom:updated>
            <content:encoded><![CDATA[<p>For a long-time we have known that the current state-of-the-art of vulnerability research in open-source code does not scale. That current state-of-art involves individual security researchers looking at specific bits of code and then reporting potential issues found to a central vulnerability database in the form of textual descriptions. If accepted (after some basic validation) the report is re-published to the world as a CVE.</p><p>While the intent of discovering issues in an ad-hoc manner and maintaining a public database of vulnerabilities comes from a genuine and good place, it’s simply fraught with fundamental problems when dealing with open-source code, including a lack of precision and accuracy of the findings, the inability to understand dynamic global dependency relationships and the inability to surface related vulnerabilities in other pieces of code. This has resulted in a woefully inaccurate and incomplete data-set on which the world now relies on when doing vulnerability assessments.</p><p>Lets take <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-1000034">CVE-2017–1000034</a> as an example.</p><p>Akka versions &lt;=2.4.16 and 2.5-M1 are vulnerable to a java deserialization attack in its Remoting component resulting in remote code execution in the context of the ActorSystem.</p><p>The CVE description of the vulnerability simply says that that the Akka framework is affected by a deserialization vulnerability. It provides no details about the underlying component that is affected or the attack vectors that can be used to exploit the issue. Because we have dedicated security researchers, we know that it is the akka-actor library that is affected and we will show later that using SGL we can actually see that the vulnerable library is used by over 357 other libraries.</p><p>After understanding the problem and spending time thinking about how best to advance the state-of-the-art, we came to theorize that it could be approached similarly to the way scientists have advanced life-sciences with gene engineering. For instance the <a href="https://en.wikipedia.org/wiki/Human_Genome_Project">Human Genome Project</a> was an international scientific research project with the goal of determining the sequence of nucleotide base pairs that make up human DNA, and of identifying and mapping all of the genes of the human genome from both a physical and a functional standpoint.</p><p>We theorized that we could map the worlds open-source code, creating representations of each bit of code and how they relate to other bits of code. We knew it was ambitious but in doing so we would essentially create a global dependency-graph and a global call-graph as well as a set of abstractions which would could be used to look for patterns, relationships and dependencies. A respected security researcher told me I was a mad-man but I like a challenge and knew we had a world class team of product R&amp;D engineers who have built static analysis tools and call graph generators. In a nod to the famous security paper “Smashing the Stack for fun and profit” I saw an opportunity to have a impact and so “challenge accepted”.</p><p>After a year of R&amp;D lead by Dr. Asankhaya Sharma and his team we are pleased to announce that our theory has proven to be significant. We now have a graph database describing the worlds open-source Java code with over 63 million nodes and 420 million edges that we are able to query and find new vulnerabilities that were previously hidden, invisible or un-discovered. We are now in the process of adding support for other languages including JavaScript, Ruby, Python, Go, PHP and C/C++ as well as working to add additional data such as binary representations, code similarity signatures and commit logs.</p><p>This technology which includes a domain specific language for finding vulnerabilities called the Security Graph Language or SGL is now being embedded into the SourceClear platform so that we can accurately surface the right data at the right time to our customers providing a level of analysis thats not been seen before.</p><p>We also think the technology can benefit the wider open-source and security communities and with a desire to give back, we have decided to open-source the language specification and a reference architecture to encourage others to explore and embrace our work. In addition, in early 2018 we will be opening up a researcher program that will allow qualified security researchers to use the technology and our infrastructure to hunt for new security issues.</p><h3>Designing the Security Graph Language</h3><p>To aid large scale analysis of open-source code we needed to design a language that would enable us to capture different bug patterns in a concise manner. SGL is designed as a graph query language and builds on top of <a href="http://tinkerpop.apache.org/">Apache Tinkerpop</a>, a graph computing framework. SGL queries are compiled to <a href="https://en.wikipedia.org/wiki/Gremlin_(programming_language)">Gremlin</a>and thus have support for both OLTP and OLAP processing.</p><p>The domain of SGL can be conceptually understood as a property graph, with vertices and edges representing entities and the relationships between them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/0*ZqM9OCKTagkUZATK.png" /></figure><p>As you can see, SGL operates over a graph which has vertices about libraries, vulnerabilities, class names, and method names. The edges capture underlying relationships like dependencies and method calls that can be used to describe instances of vulnerabilities. This enables us to express sophisticated questions like “How many libraries are affected indirectly because they themselves use a known vulnerable library?” or “How many libraries have a call chain to a particular method?”.</p><h3>Examples</h3><p>To give you a flavor of the language let’s consider a few example queries written in SGL.</p><p>In order to check all the libraries in the graph we can just do the following:</p><pre>library(language: &#39;java&#39;)<br><em># returns the list of all libraries in the graph</em></pre><p>Similarly for checking all the vulnerabilities in the graph we can run the following queries.</p><pre>vulnerability(_)<br><em># shows all the vulnerabilities in the graph</em></pre><p>Now, to check what are all the vulnerable libraries:</p><pre>library(_) where(has_vulnerability)<br><em># returns only those libraries that have a known vulnerability</em></pre><p>We can also query details about a particular library say spring-web</p><pre>let spring_web = library(language: &#39;java&#39;, coord1: &#39;org.springframework&#39;,<br> coord2: &#39;spring-web&#39;, version: &#39;4.1.6.RELEASE&#39;) <strong>in</strong> spring_web<br>let spring_web_classes = spring_web has_class <strong>in</strong> spring_web_classes<br><em># returns all the classes that are defined in the library</em></pre><pre>let spring_web_methods = spring_web has_method <strong>in</strong> spring_web_methods<br>spring_web_methods count<br><em># returns all methods in the library</em></pre><p>If you are curious as to how many libraries call Runtime.exec() :</p><pre>method(class_name:&#39;java/lang/Runtime&#39;, method_name:&#39;exec&#39;) <br>called_by method_in_library</pre><p>Surprisingly that actually returns 11k+ library versions that call exec and I bet a case of beer that at least one is malware.</p><p>Finally, if you want to check the state of open-source security you can query for all libraries that are directly or indirectly affected by any known vulnerability:</p><pre>vulnerability(_) has_version_range has_library <br>union(identity, embedded_in*, dependent_on*)</pre><p>That query alone really shows the power of SGL. Before SGL we knew that around 1,900 libraries that were affected by disclosed vulnerabilities. After SGL we know know of over 6,500 libraries that are actually affected by those same vulnerabilities.</p><p>We can also see if a particular vulnerable library is used by other libraries. Using the SGL query below we can look for libraries that themselves use the vulnerable version of akka-actor.</p><pre>vulnerability(identity: &quot;2017-1000034&quot;) has_version_range has_library union(dependent_on*, embedded_in*)<br><em># 357 vulnerable libraries found</em></pre><p>Sure enough there are 357 other libraries in the results set. We can of course now use SGL to chain the query to include actual calls to the vulnerable method for precise results.</p><p>Similarly, last year a significant vulnerability <a href="https://www.sourceclear.com/registry/security/potential-remote-code-execution-via-java-object-deserialization/java/sid-1847">SID-1847</a> was published in Apache Commons Collections (ACC) library that potentially led to remote code execution. While there has been a lot of awareness of the dangers of using this interface, using SGL we can instantly see that there are 184 libraries still using the vulnerable method of the vulnerable version of ACC including a popular directory server that if exploited could lead to significant data exposures.</p><pre>vulnerability(identity: &quot;1847&quot;) has_version_range has_vulnerable_method<br>called_by* method_in_library where(union(embeds*, depends_on*) library_in_version_range<br>version_range_in_vulnerability vulnerability(identity: &quot;1847&quot;))</pre><p>SGL goes beyond vulnerabilities and can help detect patterns of bugs at scale. E.g. consider the following Java code snippet that is used to prevent XXE attacks in an application.</p><pre>DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();<br>dbf.setFeature(&quot;http://xml.org/sax/features/external-general-entities&quot;, <strong>false</strong>);</pre><p>Based on this, we can easily construct a SGL query looking for the occurrence of potential XXE issues in Java:</p><pre>let xml_new = method(class_name:&#39;javax/xml/parsers/DocumentBuilderFactory&#39;, method_name: &#39;newInstance&#39;) <strong>in</strong><br>let xml_set_feature = method(class_name:&#39;javax/xml/parsers/DocumentBuilderFactory&#39;, method_name:&#39;setFeature&#39;) <strong>in</strong><br>let results = xml_new called_by <strong>not</strong>(calls xml_set_feature) <strong>in</strong><br>results method_in_library</pre><p>There are several exciting things happening behind the scenes that will help us work with the community to clean the upstream distributions of open-source so that we can all continue to embrace the good stuff.</p><p>You can sign up to get notified about SGL at <a href="https://www.sourceclear.com/sgl">https://www.sourceclear.com/sgl</a> or mail us at hello@sourceclear.com if you want to talk.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40eaeb7c22ce" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sourceclear/sgl-mapping-the-open-source-genome-for-fun-and-profit-40eaeb7c22ce">SGL: Mapping the open-source genome for fun and profit</a> was originally published in <a href="https://medium.com/sourceclear">SourceClear</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Delving into the four recent RubyGems vulnerabilities]]></title>
            <link>https://medium.com/sourceclear/delving-into-the-four-recent-rubygems-vulnerabilities-47bca188cb74?source=rss----7d9d7ea9d0ee---4</link>
            <guid isPermaLink="false">https://medium.com/p/47bca188cb74</guid>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[newsves]]></category>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[research-and-development]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Vanessa Henderson]]></dc:creator>
            <pubDate>Tue, 05 Sep 2017 19:29:33 GMT</pubDate>
            <atom:updated>2017-09-27T17:28:01.208Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*_iNboVBMYZqRhao6OwNYFg.png" /></figure><p>A few days ago, a <a href="http://blog.rubygems.org/2017/08/27/2.6.13-released.html">blog</a> was released by RubyLang and RubyGems stating that they had fixed multiple vulnerabilities. The four vulnerabilities that were found are described as follows:</p><p><strong>1.</strong> a DNS request hijacking vulnerability <br><strong>2.</strong> an ANSI escape sequence vulnerability <br><strong>3.</strong> a denial of service vulnerability in the query command <br><strong>4.</strong> an arbitrary file overwrite while installing a gem</p><p>Lets break these vulnerabilities down into attack types, potential impact and how they fixed the issue.</p><h3>DNS Request Hijacking Vulnerability</h3><p><strong>Attack Type</strong>: Man-in-the-middle (MitM) <br><strong>Potential Impact</strong>: Compromised Gem integrity<br><strong>Severity</strong>: High<br>RubyGem users are able to specify the gem server API location that they wish to use. This value by default is https://rubygems.org. This URL is used to make a SRV DNS request and reply; however, there was a flaw in the DNS response verification. This flaw allowed <a href="https://www.sourceclear.com/blog/Millions-of-program-builds-vulnerable-to-Man-in-the-Middle-attacks/">man-in-the-middle attackers</a> to change the url within the DNS response received from the server to a malicious one. Thinking the response is correct, the client would proceed to download gems from the malicious server. A code snippet containing a proof of concept can be found in the comments of the <a href="https://github.com/rubygems/rubygems/commit/8d91516fb7037ecfb27622f605dc40245e0f8d32">fix commit</a>.<br><strong>Fix</strong>: Matching the hostname returned in the DNS response to the hostname of the target URI.<br><strong>Fix Commit</strong>: <a href="https://github.com/rubygems/rubygems/commit/8d91516fb7037ecfb27622f605dc40245e0f8d32">This one!</a></p><h3>ANSI Escape Sequence Vulnerability</h3><p><strong>Attack Type</strong>: Escape Character Injection<br><strong>Potential Impact</strong>: Terminal output is printed incorrectly<br><strong>Severity</strong>: Low<br>Gem authors were able to insert escape characters into fields of the the gemspec that would then be printed on the end-users’ terminal upon gem installation. <br><strong>Fix</strong>: ANSI control characters are removed before printing.<br><strong>Fix Commit</strong>: <a href="https://github.com/rubygems/rubygems/commit/ef0aa611effb5f54d40c7fba6e8235eb43c5a491">This one!</a></p><h3>Denial of Service in the Query Command</h3><p><strong>Attack Type</strong>: Denial of Service (DoS)<br><strong>Potential Impact</strong>: Process temporarily hanging<br><strong>Severity</strong>: Low<br>Gem authors were able to use unlimited characters within the “summary” field for a gem. If the string given is large enough, the process would temporarily hang whenever a user tried to query for information regarding that gem.<br><strong>Fix</strong>: Gem authors are now limited to 100,000 character summaries.<br><strong>Fix Commit</strong>: <a href="https://github.com/rubygems/rubygems/commit/8a38a4fc24c6591e6c8f43d1fadab6efeb4d6251">This one!</a></p><h3>Arbitrary File Overwrite</h3><p><strong>Attack Type</strong>: Directory Traversal<br><strong>Potential Impact</strong>: Gems to be installed in unintended folders<br><strong>Severity</strong>: Medium<br>Gem authors were previously not restricted by the characters used in gem names. This allowed attackers to use the ../ character sequence within a gem name to change the location that the gem was installed on. Using this, they could potentially overwrite other files on the users’ systems when the gem is installed onto a machine. To learn more about directory traversal attacks see my previous blog: <a href="https://www.sourceclear.com/blog/Diving-into-Directory-Traversal-Vulnerabilities-in-Open-Source/">Diving into Directory Traversal Vulnerabilities in Open-Source</a>.<br><strong>Fix</strong>: Gem names may now only contain numbers, letters, underscores (_), dashes (-) and dots(.).<br><strong>Fix Commits</strong>: <a href="https://github.com/rubygems/rubygems/compare/8a38a4fc24c6591e6c8f43d1fadab6efeb4d6251...ad5c0a53a86ca5b218c7976765c0365b91d22cb2">These two!</a></p><p>As of August 31, 2017 a new version of Ruby that contains a bundled fix for the RubyGems vulnerabilities has yet to be released. While as of today, only a few people were impacted, we highly recommend that you mitigate these issues on your system. To do this, you need to upgrade your version of RubyGems by running this command:<br>gem update --system</p><p>Some of the vulnerable gems we have in the SourceClear registry are affected by similar vulnerabilities. An example of these are:</p><ul><li>Through the ciborg gem, attackers are able to overwrite files using symlink attacks (<a href="https://www.sourceclear.com/registry/security/overwritable-files-through-a-symlink-attack/ruby/sid-1720/summary">SVE-1720</a>)</li><li>Through the excon gem, attackers can perform man-in-the-middle(MitM) attacks and compromise the integrity of the gem installed (<a href="https://www.sourceclear.com/registry/security/man-in-the-middle-mitm-/ruby/sid-3363/summary">SVE-3363</a>)</li></ul><p>These vulnerabilities are SVEs (SourceClear Vulnerabilities and Exposures) identified by the security research team, which means they don’t have an NVD issued CVE number. To read more about SVEs affecting gems in Ruby see our post on <a href="https://www.sourceclear.com/blog/Rails-GEMS-Vulnerable-to-CSRF-Show-Vulnerability-Disclosure-in-Open-Source-Projects-Needs-a-Re-Think/">Cross-Site Forgery (CSRF) Attacks</a> that impacted over 50,000 Ruby developers.</p><p>If you are using Ruby and want to scan your projects, you can sign up for a <a href="https://www.sourceclear.com/demo/">demo</a> or dive right in with our free <a href="https://app.sourceclear.io/signup">30 day trial</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47bca188cb74" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sourceclear/delving-into-the-four-recent-rubygems-vulnerabilities-47bca188cb74">Delving into the four recent RubyGems vulnerabilities</a> was originally published in <a href="https://medium.com/sourceclear">SourceClear</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exposing External XML Entity Attacks in Android IntelliJ Plugin]]></title>
            <link>https://medium.com/sourceclear/exposing-external-xml-entity-attacks-in-android-intellij-plugin-aed4baf73e05?source=rss----7d9d7ea9d0ee---4</link>
            <guid isPermaLink="false">https://medium.com/p/aed4baf73e05</guid>
            <category><![CDATA[appsec]]></category>
            <category><![CDATA[research-and-development]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Vanessa Henderson]]></dc:creator>
            <pubDate>Mon, 28 Aug 2017 18:19:31 GMT</pubDate>
            <atom:updated>2017-09-27T22:59:57.479Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xadlWs4WJ4deGPxzLa-yig.png" /></figure><p>IntelliJ is an IDE that a lot of developers know and love. Not only does it provide an intuitive UI but it also gives us plugins for all the languages we love — including Android. One of our astute engineers was building the Android IntelliJ plugin when a commit message flicked past and caught his eye. The commit mentioned details on fixing an XXE vulnerability! Oh no! What exactly are XXE attacks, how do they affect IntelliJ, and what can I do about them? Lets dive deeper.</p><h3>What are External XML Entity (XXE) attacks</h3><p>XML External Entity attacks can be conducted against applications which parse XML input without the correct precautions. As you may know, XML files are structured documents which contain elements that can be parsed into objects for servers. Most XML parsers are configured by default to allow the processing of external entities. Attackers can leverage this to insert malicious data type definitions (DTD) which can be executed and inserted into the application.</p><h3>Potential impacts of XXE attacks</h3><h4>1. Information Disclosure</h4><pre>POST http://example.com/xml HTTP/1.1</pre><pre>&lt;!DOCTYPE foo [<br>  &lt;!ELEMENT foo ANY&gt;<br>  &lt;!ENTITY attack SYSTEM<br>  &quot;file:///etc/passwd&quot;&gt;<br>]&gt;<br>&lt;foo&gt;<br>  &amp;attack;<br>&lt;/foo&gt;</pre><p>When the above example is sent to an endpoint accepting XML to parse, the resulting entity created will contain the contents of the /etc/passwd file. This could also be used to target other files or even to check if certain files exist on a system; thus resulting in information disclosure.</p><h4>2. Denial of Service (DoS)</h4><pre>POST http://example.com/xml HTTP/1.1</pre><pre>&lt;!DOCTYPE foo [<br>  &lt;!ELEMENT foo ANY&gt;<br>  &lt;!ENTITY bar &quot;Ha &quot;&gt;<br>  &lt;!ENTITY e1 &quot;&amp;bar;&amp;bar;&quot;&gt;<br>  &lt;!ENTITY e2 &quot;&amp;e1;&amp;e1;&amp;e1;&amp;e1;&quot;&gt;<br>  &lt;!ENTITY e3 &quot;&amp;e2;&amp;e2;&amp;e2;&amp;e2;&amp;e2;&quot;&gt;<br>  &lt;!ENTITY e4 &quot;&amp;e3;&amp;e3;&amp;e3;&amp;e3;&amp;e3;&quot;&gt;<br>]&gt;<br>&lt;foo&gt;<br>  This is how I laugh &amp;bar;<br>&lt;/foo&gt;</pre><p>Take the above request as an example. The way that the entities are defined means that when &amp;bar; is called, the number of Ha’s printed increases exponentially. This form of XXE attack is commonly referred to as the “Billion Laughs attack”. If the attacker continued the pattern shown above they could overload the system and produce DoS conditions.</p><h4>3. Remote Code Execution (RCE)</h4><p>Using XXE attacks, remote code execution attacks are possible. To perform such attacks however, the stars have to align and the moon to be in waxing. By this I mean that the circumstances in which this type of attack is possible through an XXE flaw are limited and far between. It has been seen in the wild though: in late 2013, a computer engineer from Brazil — Reginaldo Silva — found a <a href="http://www.ubercomp.com/posts/2014-01-16_facebook_remote_code_execution">remote code execution(RCE) flaw through XXE in Facebook</a>.</p><h3>What is happening with the IntelliJ plugin?!</h3><p>On the 2nd of August, 2017, Dmitry Avdeev submitted a commit to the <a href="http://git.jetbrains.org/?p=idea/adt-tools-base.git;a=commit;h=f917c16a93249fa0a177d2511f062b5821d27483">jetbrains adt-tools-base</a>which contained fixes in multiple places for External XML Entity attacks. Prior to these commits, several of the common com.android.tools libraries located in Maven and used in the IntelliJ Android plugin did not restrict what entities could be parsed. This would have allowed attackers to declare document types and use that to access files or cause denial of service conditions.</p><p>Great! They fixed it though right? Yes… but no. After the initial fix, a subsequent commit which occurred 6 days later reverted one of the fixes. The <a href="http://git.jetbrains.org/?p=idea/adt-tools-base.git;a=commit;h=a778b2b88515513654e002cd51cbe8eb8226e96b">commit in question</a> removed a restriction on document type declaration in:</p><pre>common/src/main/java/com/android/utils/PositionXmlParser.java</pre><p>It remains to be seen why this was reverted.</p><p>If you use libraries under the com.android.tools group ID, you should know that the library has yet to be updated on Maven. Fear not though! For SourceClear customers <a href="https://www.sourceclear.com/registry/security/xml-external-entity-xxe-attacks/java/sid-4902/summary">SVE 4902</a> contains the latest information and will be updated when a fixed version has been released.</p><h3>How can I avoid XXE attacks?</h3><p>External XML Entity attacks can easily be avoided by disabling doctype declarations.The code for this would look something like</p><pre>factory.setFeature(&quot;http://apache.org/xml/features/disallow-doctype-decl&quot;, true);</pre><p>There are subtle nuances depending on the langauge and the parser that you are using. For a highly detailed and concise guidance on these nuances, OWASP has a great <a href="https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Prevention_Cheat_Sheet">XXE Prevention Cheat Sheet</a>.</p><p>If you’re interested in hearing more about finding vulnerabilities and malware in open-source code at scale, <a href="https://www.sourceclear.com/webinar/vulnerabilities-and-malware-open-source-code/"><strong>REGISTER for our live webinar</strong></a> on September 6th 9 AM PST with Mark Curphey, CEO and Founder of SourceClear.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aed4baf73e05" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sourceclear/exposing-external-xml-entity-attacks-in-android-intellij-plugin-aed4baf73e05">Exposing External XML Entity Attacks in Android IntelliJ Plugin</a> was originally published in <a href="https://medium.com/sourceclear">SourceClear</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Diving into Directory Traversal Vulnerabilities in Open-Source]]></title>
            <link>https://medium.com/sourceclear/diving-into-directory-traversal-vulnerabilities-in-open-source-2bdb92d1bb4?source=rss----7d9d7ea9d0ee---4</link>
            <guid isPermaLink="false">https://medium.com/p/2bdb92d1bb4</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[appsec]]></category>
            <category><![CDATA[research-and-development]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Vanessa Henderson]]></dc:creator>
            <pubDate>Tue, 22 Aug 2017 17:05:48 GMT</pubDate>
            <atom:updated>2017-09-27T23:02:08.569Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*osdEEcU3ViISHDxYIHfNCQ.png" /><figcaption>Directory Traversal Premium SourceClear Vulnerabilities and Exposures (SVEs)</figcaption></figure><p>On August 8th, 2017 <a href="https://blogs.sap.com/2017/08/08/sap-security-patch-day-august-2017/">SAP released a set of security patches for its applications</a>. Among the vulnerabilities that they fixed was a directory traversal in the SAP NetWeaver AS Java Web Container. With a CVSS score of 7.7, this vulnerability is high risk and was addressed quickly. If left untreated, directory traversal vulnerabilities can result in files being overwritten, directories being exposed, and files being explored.</p><p>This isn’t the first time that a large company has been hit with this type of vulnerability. In 2016, in ‘<a href="http://www.csoonline.com/article/3207524/data-breach/chances-are-good-that-you-re-already-infected.html">Chances Are Good…That You’re Already Infected</a>’, Matt Ireland revealed that directory traversal attacks are one of the most common types of attacks to occur in the financial sector — also the industry with the highest total attack volume. Today, we are going to have a closer look into directory traversal attacks and what impacts they can have.</p><h3>What is a Directory Traversal Attack?</h3><p>A directory traversal attack can be used to access restricted files or directories of a web server. There are many reasons that these vulnerabilities may be created such as the lack of URL and relative path checking, or insufficient handling of a request path or URL. The most common attack vector for directory traversals that we have seen is the use of the string ../. Using this string, attackers are able to access directories that they shouldn’t have access to. It is due to this, that the directory traversal attack may also be called a dot-dot-slash attack or directory climbing.</p><p>Let’s take a look at a few directory traversal vulnerabilities from the <a href="https://www.sourceclear.com/registry/search#query=Traversal%20type:vulnerability">SourceClear Registry</a>.</p><h3>Examples of Open-Source Packages vulnerable to Directory Traversal Attacks</h3><h4>Overwriting arbitrary files</h4><p>Attackers can overwrite files in the python package <a href="https://pypi.python.org/pypi/moin">Moin</a> (aka MoinMoin) using directory traversal attacks. <a href="https://www.sourceclear.com/registry/security/directory-traveral-through-attachfile-action/python/sid-2105/summary">These attacks</a> are possible because of neglect in checking the filenames of attachments. Attackers can leverage the .. (dot dot) string within the filename to change the directory in which the file is to be saved. This vulnerability was fixed by validating the filename sent to the _do_attachement_move method of action/AttachFile.py. This vector was also discovered to be able to be used against mixlib-archive in <a href="https://www.sourceclear.com/registry/security/directory-traversal/ruby/sid-4575/summary">CVE-2017-1000026</a>.</p><h4>Directory Listing Exposure</h4><p>Just because validation exists however, doesn’t mean that you are safe. Apache Tomcat servers has some form of validation, but it is <a href="https://www.sourceclear.com/registry/security/directory-traversal/java/sid-2046/summary">incorrectly implemented</a> allowing attackers to expose directory listings for $CATALINA_BASE/webapps. The validation will filter resource requests with a path including the /…/ string, but will allow paths with the /… string through. This vulnerability was fixed by adding to the validation of the paths. Other examples with the same flaw can be seen in popular packages such as <a href="https://www.sourceclear.com/registry/security/file-access-through-directory-traversal/java/sid-1498/summary">Spring Core</a> and <a href="https://www.sourceclear.com/registry/security/directory-traversal-vulnerability/java/sid-1580/summary">Spring Web MVC</a>. This has also been seen recently in a study done by <a href="https://github.com/JacksonGL">Liang Gong</a> where he found this attack vector can be used in 133 different <a href="https://www.sourceclear.com/registry/security/directory-traversal/javascript/sid-4561/summary">npm packages</a>.</p><h4>Access files on Windows machines</h4><p>The validation may also be lacking certain characters. <a href="https://www.sourceclear.com/registry/security/directory-traversal-windows/python/sid-2159/summary">Attackers can access directories</a> and files outside of the intended scope in a Windows based machine running an application written in <a href="https://pypi.python.org/pypi/Django">Django</a>. Django stores session data in a file named with the session key. The key submitted in the session cookie is verified by checking whether the filesystem path includes a path separator character as specified by Python’s os.path.sep. The characters specified are insufficient for a Windows based filesystem as it allows many path separators. If an attacker is able to pass this initial validation, the attack can be successful.</p><h3>So, How Can You Avoid Directory Traversal Attacks?</h3><p>The truth is you can’t 100% avoid directory traversal attacks but you can take preventative measures. A good start however, would be to implement thorough validation of any filenames, path requests, and urls that can be inserted or controlled by users. This validation will need to take into account the multitude of <a href="https://technet.microsoft.com/en-us/library/cc731237(v=ws.11).aspx">path separators</a> that Windows supports, as well as other operating systems. For web applications, it is also advised to not store any sensitive information on the webserver itself so that in the event an attacker does bypass the validation, there is nothing of value they can access. In addition to these steps, SourceClear also has 43 <a href="https://www.sourceclear.com/blog/New-SVEs-Vulnerabilities-Never-Die/">SVEs (SourceClear Vulnerabilities and Exposures)</a>as well as CVEs which we can identify in your dependencies through a simple scan.</p><p>Are you curious about a certain type of vulnerability? Email me directly at <a href="mailto:vanessa@sourceclear.com">vanessa@sourceclear.com</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2bdb92d1bb4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sourceclear/diving-into-directory-traversal-vulnerabilities-in-open-source-2bdb92d1bb4">Diving into Directory Traversal Vulnerabilities in Open-Source</a> was originally published in <a href="https://medium.com/sourceclear">SourceClear</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Open-source Packages with Malicious Intent]]></title>
            <link>https://medium.com/sourceclear/open-source-packages-with-malicious-intent-142fec637f19?source=rss----7d9d7ea9d0ee---4</link>
            <guid isPermaLink="false">https://medium.com/p/142fec637f19</guid>
            <category><![CDATA[software-security]]></category>
            <category><![CDATA[research-and-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[information-security]]></category>
            <dc:creator><![CDATA[Vanessa Henderson]]></dc:creator>
            <pubDate>Wed, 09 Aug 2017 20:25:02 GMT</pubDate>
            <atom:updated>2017-09-27T23:05:28.470Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why re-invent the wheel?</h3><p>This famous saying is what I think of when thinking about third-party code. Package managers such as npm, RubyGems, and Maven make it so easy to share code that has been written between people that developers use it for tasks as small as checking if a number <a href="https://www.npmjs.com/package/is-positive">is positive</a>. This is absolutely great but how many of us stop to think about what exactly is going on behind-the-scenes, under-the-hood, behind-the-magic curtain?</p><p>Developers could have written any number of vulnerabilities, backdoors, or malicious activities into the library that they are providing for your use and you may never know. It is true that one could closely inspect the code content but in reality, developers don’t often have time for that. But what could they possibly do? Great question.</p><p>Any number of things could be written into the code, but let’s take a look at the rimfall example. Back in 2015, <a href="https://blog.liftsecurity.io/2015/01/27/a-malicious-module-on-npm/">Lift security</a> wrote a post on how the pre-install hook in the rimfall npm package contained and executed the command rm -rf /* onto the user’s system. This library only existed within the npm registry for 2 hours after the bad behaviour attracted the HackerNews community.</p><h3>The above example wasn’t widespread but what if this had happened with left-pad?</h3><p>In March, 2016 a popular npm package left-pad was removed by the developer <a href="https://twitter.com/afrikaradyo">Azer Koçulu</a> after a name dispute over another package he maintained (See <a href="http://blog.npmjs.org/post/141577284765/kik-left-pad-and-npm">here</a> for the full story). At the time, once a package had been removed from npm by a developer, any other user was able to upload a different package with the same name. When left-pad was removed, it had <a href="https://www.theregister.co.uk/2016/03/23/npm_left_pad_chaos/">a catastrophic</a> impact on the development community as this package was very popular and wide-spread. Had an attacker been quick on his feet, he would have been able to upload a package named left-pad which had the same functionality as the original package, but also with malicious activities. If done fast enough, many people would have been none-the-wiser. A similar case was identified on August 1st, 2017 by <a href="https://twitter.com/o_cee">Oscar Bolmsten</a> when he tweeted this message to <a href="https://twitter.com/kentcdodds">Kent C. Dodds</a> the owner of the popular <a href="https://www.npmjs.com/package/cross-env">cross-env</a> package.</p><blockquote><a href="https://twitter.com/kentcdodds">@kentcdodds</a> Hi Kent, it looks like this npm package is stealing env variables on install, using your cross-env package as bait: <a href="https://t.co/REsRG8Exsx">pic.twitter.com/REsRG8Exsx</a></blockquote><blockquote>— Oscar Bolmsten (@o_cee) <a href="https://twitter.com/o_cee/status/892306836199800836"><strong>August 1, 2017</strong></a></blockquote><p>He pointed out that his package was being typo-squatted by a package with malicious intent. Typo-squatting is an attack by which the attacker relies on user mistakes. By choosing the similar package name crossenv the developer (who signed up to npm using the name <a href="https://www.npmjs.com/~hacktask">hacktask</a>) banked the spread of his malicious package on the fact that people may accidentally choose to download crossenv instead of cross-env. The user, who has since been removed from npm, also had published an additional <a href="http://blog.npmjs.org/post/163723642530/crossenv-malware-on-the-npm-registry">37 type-squatted packages.</a></p><p>The malicious package that hacktask had published would take the environment variables and send them to the npm.hacktask.net url. If you are interested in other impacts that these attacks might have, check out the post <a href="https://www.sourceclear.com/blog/Abusing-npm-libraries-for-data-exfiltration/">“Abusing npm libraries for data exfiltration”</a> that Asankhaya wrote late 2016.</p><h3>How can you find if any part of your code is sending data to an unexpected source?</h3><p>SourceClear previously released a tool named Build Inspector — a <a href="https://www.sourceclear.com/blog/Build-Inspector---A-forensic-sandbox-for-Continuous-Integration-environments/">forensic sandbox for continuous integration environments.</a> Among other things, Build Inspector can be used to provide an overview of the network traffic made during the build.</p><p>Using the “Network activity” tab, you can find all resolved domain names, as well as any insecure requests which are being made over HTTP, an example of which is listed below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mMDtpWjHxcR7BH5m.png" /></figure><p>By reviewing this list, a knowledgeable developer will be able to identify any potentially malicious activity that may be happening. In the example shown above, there are 2 suspicious items to note. Both suspicious items revolve around the areweflashyet.com domain. This isn’t a url that one would expect to see in a build. It may be a sign that there is some malicious activity going on. After investigation, even if you found that the communication with areweflashyet.com is legitimate, it will still be listed under “Insecure Network Activity” which means that it is not being conducted using HTTPS. This alone leaves you vulnerable to <a href="https://www.sourceclear.com/blog/Millions-of-program-builds-vulnerable-to-Man-in-the-Middle-attacks/">Man-in-the-Middle (MitM) attacks</a>.</p><p>With more intimate knowledge of the build process and time, developers may also use the report that Build Inspector produces to find any unexpected file changes or executed commands that happen during the build process. Using Build Inspector on any unknown or suspicious dependencies uncovers insights on whether any fancy activities such as the theft of environment variables happened during build. Apart from dealing with npm builds, Build Inspector can also be used to perform and monitor builds with gradle, mvn, and gem. This makes it easy for Build Inspector to be the go to place for testing new, unknown, dependencies before allowing them to be part of your production build(s).</p><p>For more information on Build Inspector, its requirements, usage, and several examples, can be found at the following GitHub repository: <a href="https://github.com/continuous-security/build-inspector">https://github.com/continuous-security/build-inspector</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=142fec637f19" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sourceclear/open-source-packages-with-malicious-intent-142fec637f19">Open-source Packages with Malicious Intent</a> was originally published in <a href="https://medium.com/sourceclear">SourceClear</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing SourceClear x Atlassian JIRA Cloud Integration]]></title>
            <link>https://medium.com/sourceclear/announcing-sourceclear-x-atlassian-jira-cloud-integration-eeae6b251c8?source=rss----7d9d7ea9d0ee---4</link>
            <guid isPermaLink="false">https://medium.com/p/eeae6b251c8</guid>
            <category><![CDATA[atlassian]]></category>
            <category><![CDATA[product]]></category>
            <category><![CDATA[sourceclear]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[jira]]></category>
            <dc:creator><![CDATA[Lin Ling]]></dc:creator>
            <pubDate>Thu, 27 Jul 2017 17:26:01 GMT</pubDate>
            <atom:updated>2017-07-27T18:12:44.087Z</atom:updated>
            <content:encoded><![CDATA[<p>At SourceClear we believe that software security should be integrated into the application development workflow and that it shouldn’t be a hindrance to developers. We are committed to making it easier for security teams to collaborate with developers and we are pleased to announce the new Atlassian JIRA Cloud integration.</p><p>This integration allows security teams to create auto-filled JIRA issues directly from SourceClear, making it easy to work with developers to resolve security issues. The issue is then linked to a JIRA ticket so that developers can easily refer to the full details of the security issue.</p><h3>How the JIRA Cloud Integration works</h3><p>The JIRA Cloud Integration works by setting up an OAuth connection to your organization’s JIRA. Once this has been set up and authorized, you can configure ticket templates to easily create tickets later. Templates allow tickets to be created in repeatable ways and enable you to enforce fields such as where the ticket is created, who the ticket is assigned to, and what the priority is, among others. An example template is below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BfzWMrayfozmYiPM.png" /></figure><p>Once the template has been created, users will now have access to create a ticket from a SourceClear issue. You’ll be presented with a set of actions for an issue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*cjKkjjdEkCOz3Xh9S-YJDA.png" /></figure><p>The JIRA Cloud option will let you select a template and then create a JIRA ticket with that template.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*EMVVjw8CSykNnS260ID8Yg.png" /></figure><p>Once you click ‘Create’, a ticket will automatically be created in JIRA with the supplied information. This ticket will be linked to the SourceClear issue so multiple issues are not created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3ZXJivakI2DU4E8z.png" /></figure><p>And the linked issue looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/0*R4cZPGUTfG31hM3A.png" /></figure><p>For full documentation on the new JIRA integration view the <a href="https://www.sourceclear.com/docs/atlassian-jira-cloud/">documentation page here</a>.</p><h3>Didn’t SourceClear already support JIRA?</h3><p>Yes; however, we encourage all JIRA Cloud users to migrate to the new integration due to its added functionality. If you have an on-premise JIRA installation or would like to stay with the current functionality a little longer, you can access the previous integration by selecting “JIRA Enterprise” as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*cjKkjjdEkCOz3Xh9S-YJDA.png" /></figure><h3>Looking towards the future</h3><p>This new feature is another step toward seamlessly integrating application security into your application development workflow. Give it a go by logging in <a href="https://app.sourceclear.io/login">here</a> or signing up <a href="https://app.sourceclear.io/signup">here</a> and please let us know what you think!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eeae6b251c8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sourceclear/announcing-sourceclear-x-atlassian-jira-cloud-integration-eeae6b251c8">Announcing SourceClear x Atlassian JIRA Cloud Integration</a> was originally published in <a href="https://medium.com/sourceclear">SourceClear</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What DevOps means for Software Security]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/sourceclear/what-devops-means-for-software-security-a1819b343040?source=rss----7d9d7ea9d0ee---4"><img src="https://cdn-images-1.medium.com/max/600/1*8YU3N0raEl01IoZuogK_EA.png" width="600"></a></p><p class="medium-feed-snippet">In this post, I explore the landscape of security in a DevOps world, critique existing approaches like DevSecOps, and offer best practices&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/sourceclear/what-devops-means-for-software-security-a1819b343040?source=rss----7d9d7ea9d0ee---4">Continue reading on SourceClear »</a></p></div>]]></description>
            <link>https://medium.com/sourceclear/what-devops-means-for-software-security-a1819b343040?source=rss----7d9d7ea9d0ee---4</link>
            <guid isPermaLink="false">https://medium.com/p/a1819b343040</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[application-security]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[research-and-development]]></category>
            <category><![CDATA[thought-leadership]]></category>
            <dc:creator><![CDATA[Asankhaya Sharma]]></dc:creator>
            <pubDate>Thu, 06 Jul 2017 06:50:19 GMT</pubDate>
            <atom:updated>2017-07-06T08:19:25.966Z</atom:updated>
        </item>
    </channel>
</rss>