Traditional applications in most organizations consist of:
- An operating system, web server and database layer that provices core services
- A product based framework of code (such as SharePoint) which provides a vendor-managed platform which our custom code builds on
- 3rd party products that give us additional capabilities (e.g. custom web parts in SharePoint applications)
- Compiled code written in C# for custom server side code
- Front end HTML, CSS and JS
Most organizations have a well-established process of mitigating the risk of these applications: we have trust in our vendors that they are providing security updates and will respond to threats. We scan our custom code with automated tools to validate that they are not introducing security issues. We have full transparency over what 3rd party components we are using, and in the on-premises model we have complete control over when and how these components are updated.
This model changes substantially in the new world of modern web application development. The architecture now looks like this:
- A set of REST / ODATA APIs made available by our vendors (e.g. Azure, Office 365)
- A chained set of JavaScript modules, often hosted by 3rd party CDNs
- As an example, a simple SharePoint Framework web part involves over 35k files across around 900 open source modules
- The custom assets for the application (usually TypeScript, LESS, images and HTML)
For the example above, the developer has typed a single command to scaffold a starter application, but everything else is automatically included because it is ultimately used by the SharePoint Framework. In 99% of cases noone – not the developer, the operations team or the architect – would not be able to easily list out those modules, let alone who wrote and maintained the code they are relying on.
The industry has not come up with a good way to mitigate this risk. At the moment, even if we discovered that there was a security problem with a specific JS library, we have no comprehensive way to determine which of our applications are potentially impacted by that. We have no way to record what versions of what tools we are using.
The nightmare scenario:
- A zero day vulnerability is uncovered in either the browsers that are used by our consumers, or in a vendor product such as Office 365
- A JS library that we have unknowingly used in one of our applications is modified to include an exploit of this vulnerability
- This is automatically used via a CDN or downloaded via node.js
What can we do about this?
We need to actively seek to reduce this threat in the following ways:
- Provide better, more comprehensive guidance over the use of 3rd party JS frameworks to your developers, and educate your security and risk stakeholders
- Understand what tools exist to perform automated security reviews of modern JS based applications
- Start recording which applications are using what JavaScript libraries, potentially via a scan of your source control system, or as a part of your deployment strategy.
- Ensure your application security team are actively monitoring breaking news about JS module vulnerabilities
In the next post I will explore some of these options in more detail.

