The State of Open Source PDF
The State of Open Source PDF
2017
The State of
Open Source
Security
The open source landscape is vast and only getting more diverse.
The overall security of open source is an important measuring
stick. We need to know where we stand today to know what we
can do better.
At a Glance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 3
The Future of
Open Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p. 18
For more information: https://snyk.io | contact@snyk.io
THE STATE OF OPEN SOURCE SECURITY
There’s no guarantee of the security
2.5
seen a large increase in
The median time from inclusion to discovery
for in application libraries: years vulnerabilities, but coverage
can be an issue.
PERCENTAGE OF VULNERABILITIES
COVERED BY THE NVD:
npm . . . . . . . . . . . . . . 11%
Once discovered, maintainers
generally react very quickly. Rubygem . . . . . . . . . 67%
Adoption
The use of open source components is booming, no matter libraries by 32%, the number of Maven artifacts by 28% and the
which ecosystem you look at. number of npm packages by 57%.
Through September of this year, 6.3 billion Python packages Meanwhile, the number of public applications available on
have been downloaded using PyPi and over 87.3 billion Node Docker Hub is now over 900,000, up from around 460,000
packages using npm. a year ago.
In the last year (October 1, 2016, to October 1, 2017), the number Simply put, there has never been a wider variety of open source
of open source packages indexed has exploded. The number components available, and it’s never been easier for us to
of Rubygems has increased by 10.3%, the number of Python use them.
400
25
375
350
23
325
300 21
275
250 19
225
200 17
175
150 15
NOV FEB MAY AUG NOV FEB MAY AUG
2016 2017 2017 2017 2016 2017 2017 2017
60%
50%
40%
30%
20%
10%
0%
npm PyPi Maven Rubygems
43.7% 16.8%
challenges from a security standpoint. There are no “rules” that
open source development must follow to ensure a secure delivery,
so the security posture differs dramatically from one project to
another. The challenge for open source maintainers is that they of open source of open source
maintainers maintainers
are often maintaining these open source resources in addition to
have never had a consider security
other day-to-day work, and so don’t have an abundance of time
security audit know-how to be high
and resources to put towards securing their projects.
How Maintainers
Rank Their Security How Often Maintainers
Expertise Audit Their Code
Next to At least
nothing At least quarterly
1% once a year
11%
Low High
13%
26% 17%
Once or Never
Medium
56%
twice 44%
32%
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
Red Hat Linux Vulns
by Year REGULAR
CRITICAL
400
In a test we conducted of over 350
430,000 sites, 77% of them 300
were running at least one 250
library with a known security 200
vulnerability in place. 150
100
50
0
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
70 NODE
60
50
40
30
20
10
0
2013 2010 2014 2017
Discovering Vulnerabilities
How vulnerabilities are discovered and how long
they go unnoticed.
Releasing Fixes
The time it takes from disclosure to when a
vulnerability is addressed.
Notifying Users
How users are made aware of fixes to vulnerabilities.
The median time from when a vulnerability was introduced As a result, maintainers say they learn about vulnerabilities in
(included in a formal release) in an application library and when a variety of different ways. The vast majority of vulnerabilities
it was publically disclosed is 2.53 years (924 days). Studies have are discovered by someone outside of the project—only 25% of
repeatedly shown that for Linux vulnerabilities, on the other maintainers say they’ve discovered a vulnerability themselves.
hand, the time from introduction to public disclosure is around Open source maintainers are just as likely to receive a private
five years. This amplifies the importance of frequently conducting disclosure (31.4%) as they are to have a public issue filed on their
security audits—it’s very likely that there are numerous other repository (30.3%).
vulnerabilities that have just not yet been disclosed. Formally
Maintainers who have a public facing disclosure policy in place
auditing code is an important step for maintainers to take to
are far more likely to receive a private disclosure than those who
ensure the security of their projects.
do not. About 21% of maintainers with no public disclosure policy
have been notified privately about a vulnerability, compared to
How Do Maintainers Find Out 73% of maintainers with a disclosure policy in place.
About Vulnerabilities? There may also be some confirmation bias in play. While only
How these issues are disclosed and addressed are critical 13.5% of maintainers with a disclosure policy in place say
characteristics of the project’s overall security. In an ideal world, they’ve never had a security issue to their knowledge, 32% of
vulnerabilities should be reported to maintainers privately, letting maintainers with no policy say they’ve never had a security issue
them fix it before the world learns about the flaw. to their knowledge. While this could be the case of maintainers
putting a policy in place only after they’ve first had a security
In practice, the process of vulnerability disclosure doesn’t always issue reported to them, given the complications involved in
go smoothly. In part, this is because public facing disclosure disclosing without the guidance provided by a disclosure policy,
policies are few and far between. 79.5% of maintainers said that it’s just as likely that many vulnerabilities have been found and
they had no public-facing disclosure policy in place. This lack not disclosed.
of clear communication about disclosure makes it challenging
for researchers to report vulnerabilities in a private and
responsible manner.
Vulnerabilities: Vulnerabilities:
Inclusion to Disclosure Disclosure to Fix
0 days 0 days
Minimum time from inclusion to disclosure Minimum time from disclosure to fix
Ruby
Rate of Fixing
While the cadence for fixes was Node
16.1%
Most of the time, fixes aren’t backported to other version
streams. Only 16.1% of the vulnerabilities in the Snyk DB have
fixes backported to other versions streams. The situation is
pretty much the same across ecosystems, except npm where
backporting is particularly rare: only 4.1% of npm fixes are applied Vulnerabilities in the
to other version streams.
Snyk database that have
The lack of backporting makes it hard for many to upgrade to the
new fix, as moving to a new major version of a library requires
fixes backported to other
time and effort to make any updates necessary to conform to the versions streams
changes the library made.
npm
Ruby
Python
Java
25%
88% They Don’t
Release Notes
10% 34%
88% File a CVE Deprecate
the Version
of maintainers
inform users through
release notes 3% Inform a Service
Like Snyk or Ruby Sec
CVE By Year
10,000
7,500
5,000
2,500
0
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
vulnerabilities—from remediation details to providing a Common This federated approach to maintaining the vulnerability database
Product Enumeration (CPE) that helps to pinpoint which is effective, but many vulnerabilities are still missed.
product or application contains the vulnerability and a Common
Comparing to our open source vulnerability database, CVE/
Vulnerability Scoring System (CVSS) score to provide some
NVD coverage varies dramatically depending on the language
indication of the severity and characteristics of the vulnerability.
and ecosystem. For example, NVD covers only 67% of Rubygem
Overall, adoption of the NVD has been positive. Since its launch vulnerabilities and only 11% of npm vulnerabilities.
in 1999, the NVD has grown to over 81,000 vulnerabilities and
The other challenge CVE/NVD faces is the pace. While a CVE may
shows no signs of slowing down. Already in 2017, over 8,500
get applied relatively early, it frequently takes a long time for that
vulnerabilities have been added to the database—more than any
same vulnerability to make its way into the NVD and get a CVSS
other year in the history of its existence.
score and a CPE.
0–1 week
1–4 weeks
4–8 weeks
8–12 weeks
12–16 weeks
16–20 weeks
20–24 weeks
24–28 weeks
28–32 weeks
32–36 weeks
36–40 weeks
40–44 weeks
44–48 weeks
48–52 weeks
52+ weeks
25 50 75 100
According to our survey, developers use a variety of methods In fact, 38.7% of users don’t use tooling to help keep their
to keep their dependencies up to date—including occasional dependencies up to date. This inevitably leads either to situations
sweeps to bump versions (46.9%), using tools to alert them to where dependencies are not updated as frequently as they
vulnerabilities (41.6%), using tools to alert them to new versions should be, or to situations where a lot of strain is put on the
of dependencies (37.2%) and word of mouth (8.6%). development process.
Surprisingly, 16.3% of users say they don’t update their In the absence of tooling, an organization that takes security
dependencies. And while at first glance, the number of seriously must manually verify and validate new versions
users taking advantage of tools to help them manage their of dependencies to ensure its up-to-date and free of known
dependencies seems alright, there’s a lot of overlap. Quite a few vulnerabilities. In the face of the rapid rate of change within
users use both a tool to alert them to new versions and a tool to the open source community, this manual approach becomes
alert them to security issues. a troublesome bottleneck and is unmaintainable.
42%
47% Use tools to alert them 16.3%
to vulnerable of users say they
dependencies don’t update their
Occasionally dependencies
do a sweep to
bump versions
16%
9% 37% They don’t
update
Update when
they overhear or Use tools to update
someone points
out on new version of
dependencies
75%
50%
25%
0%
July October January April July
2016 2016 2017 2017 2017
It’s clear we have some room for improvement, but it’s also If you’re pulling open source
clear we have a lot of opportunities to do so. It’s easy to see that components into your application, there
maintainers are eager to make their projects more secure and
are a few things you can do as well:
that users want to make security a priority in their open source
consumption. It’s just a matter of ironing out the wrinkles a bit. 1. Use a tool to automatically detect known vulnerabilities
in your third-party components so you can fix them as quickly
If you’re a maintainer, take three simple as possible.
steps to get started: 2. Contribute back. Most of the time, maintainers are working
1. Make sure your project has a public facing disclosure hard on open source projects in addition to their day-to-day
policy so that anyone who finds vulnerabilities can quickly report work. Rolling up your sleeves and helping address issues is one
them to you. of the best ways to ensure your favorite project stays healthy
and secure.
2. Run regular audits and security checks against your
codebase to make it easier for you to catch vulnerabilities before 3. Report vulnerabilities as responsibly as possible. If
they become public. you find something amiss, look for a private way to tell the
maintainers about it. If there’s no public disclosure policy, see
3. Make it clear to users of your project that you care if you can discretely inform them through email or some other
about security. Have detailed information that is clearly form of communication.
presented to them when a security issue is addressed, so they
know exactly how to proceed.