r/programming • u/[deleted] • May 12 '20
Out-of-date, insecure open-source code is everywhere
https://www.zdnet.com/article/out-of-date-insecure-open-source-software-is-everywhere/100
u/upofadown May 13 '20
What can you do about this, besides having Synopys's Black Duck Audit Services, or similar companies, audit your code?
So this was mostly an advertisement for an auditing service...
21
u/greenthumble May 13 '20
After that it says:
organizations should "continuously build a detailed software bill of materials (BOM) for each application providing full visibility into components
Yeah. On top of documenting my code we now have to list every single thing our apps use?
Don't we mostly already do that nowadays? In requirements.txt or composer.json or package.json? And how deep does this rabbit hole go? If we just list our top packages it's possible that in the future it may be difficult or impossible to re-create a package listing e.g. if authors or NPM removes packages etc.
I feel like this is a pretty big waste of time but what the heck do I know. Perhaps I'm pennywise pound foolish but I'm just not seeing it.
16
u/rcxdude May 13 '20 edited May 13 '20
If you want to reduce the risk of suprise legal problems, you should have an idea of what all the licenses of the software that you're using require of you. And you can't assume that your dependencies have actually done the right thing either: a project you depend on may depend on another system with an incompatible license. (And this is true of both open-source and commercial licenses: read and understand your damn licenses).
And there are tools for most package managers which make the actual drudge work of getting the list of transitive dependencies and their licenses pretty easy (though I have found some are often incomplete or even worse, incorrect).
10
u/tsimionescu May 13 '20
Yes, my company requires exactly this. For every product, we must create a list of ALL of the 3rd party software we use, including all transitive dependencies. And no "Ubuntu" is not 1 3rd party. For every Linux distro we use (e.g. in a container), there are usually hundreds to a couple thousand 3rd parties from that alone.
It's a massive pain, even with automated tools which do the hard work. Especially when you then need to explain for each package HOW we use it, so that the legal department can check whether we comply with the license. Oh, and we also try to distribute the sources of all of these 3rd parties with the product, for the specific builds we used, as required by some OSS licenses (or at least to keep the sources archived in case some customer requests them). And yes, this almost certainly includes a copy of left-pad somewhere...
I will re-iterate that it is a massive pain, but theoretically required if you want to keep up to date with security patches and to ensure you are complying with all licenses.
6
u/bananaphophesy May 13 '20
For some types of software this would actually be incredibly helpful. I'm thinking of medical device software where there are regulations around the use of third party software.
Basically it's straightforward to prove the inherent safety characteristics of code that I write because I can design and develop it with safety in mind, but it's much harder to demonstrate the safety of the 187+ JavaScript libraries or platform dependencies my project pulls in.
4
u/oblio- May 13 '20
It depends on what your software does. If you build websites using Wordpress and JQuery, just ignore these things.
If your software touches money or healthcare stuff or anything which has a major impact on people's lives, then do that and do it well. Run a vulnerability scanner for your dependencies, check its reports and fix those issues ASAP, lock your dependencies down and update them only through an explicit decision/approval, have a private repo that mirros the remote dependencies so that packages don't get lost, etc.
4
u/biggerwanker May 13 '20
Do you use Azure Dev Ops? If you do you should look up component governance. It'll scan through your commits, look for and catalog components being used. I'm sure there are solutions other than Microsoft out there too.
2
u/corsicanguppy May 13 '20
Yeah. On top of documenting my code we now have to list every single thing our apps use?
Sure. On my machines I can quickly query which version of which deliverable contains which binary and which version.
Don't we mostly already do that nowadays? In requirements.txt or composer.json or package.json?
Yeah, but the short-sighted kids in those ecosystems don't understand Single Source of Truth and coordination with the built-in metadata catalogue in Enterprise systems and OSes.
And how deep does this rabbit hole go?
Just down do the checksums on the files in the immutable artifacts which delivered libraries, templates and binaries used by the project. Or, so it's been for almost 25 years.
If we just list our top packages it's possible that in the future it may be difficult or impossible to re-create a package listing e.g. if authors or NPM removes packages etc.
'top' packages? So, almost a complete list? So, an incomplete list? So, not a useful list?
Don't get me wrong: I'm overjoyed that people are remembering the adequate art of accounting for every static object on a system (and consistently configuring the unique dynamic objects via statically-delivered generators (eg PYO caches from PYs)) so it can be queried, catalogued and flagged for licensing or updates. Understand there's an entire iceberg below that tip, filled with the detritus of bad decisions (like artefacts which then self-customize and immediately diverge from recorded metadata on static objects); and understand that the more you see in 2020 the more you'll be baffled by the decisions made by otherwise really smart people.
4
u/prabhus May 13 '20
tl,dr; we are working hard to fix this and need your help!
There are two options for any #security company:
Sell this fear to sell your commercial product
Decide to do something about this by removing the cost and adoption barrier
@shiftleft we decided to do the latter. Our scan product https://slscan.io/ GitHub Repo is free and open source! It is also the most easiest product to use and integrate. We have a free and open source VS code extension and integrations with a large number of CI/CD pipelines
Oh, in case you have missed we are also natively integrated with GitHub code scanning.
I'm quite confident we can reverse these stats and make all software #oss and commercial secure everywhere.
1
u/emn13 May 14 '20
Especially bits of misleading quackery like
Even more worrying is that 75% of audited codebases contain open-source components with known security vulnerabilities.
So lemme guess at what they really mean - they look at deps, and look at if there are newer versions with security fixes, and if so, count that as a "component with known security vulnerabilities". Perhaps they also look at public vuln. announcements, or some similar concept.
Fair, right? But of course the vast majority of those cases have 0 impact on most consumers. People announce security vulnerabilities because it's conceivable that certain usages of a library may be insecure. Not all of them, by a long stretch! So that 75% is "true" and also misleading; 75% may have deps with warnings, but of those only a tiny fraction are typically relevant. How large is that fraction? I don't know, but having that number would actually make a case that this perhaps matters... or perhaps doesn't, and isn't simply product-pushing FUD.
196
u/Caraes_Naur May 12 '20
Out of date, insecure proprietary code is also everywhere, and more likely not identified as such.
26
u/sybesis May 12 '20 edited May 13 '20
Kinda remind me a story about one of our customer using a inventory system (CLI) localized in Romanian because it was bought from a random roman guy a long time ago..
edit: Romanian not roman
50
8
u/lelanthran May 13 '20
The numeric fields were probably quiet hard for the users to understand.
4
u/ObscureCulturalMeme May 13 '20
As the Romans hadn't adopted the concept of zero from the Phoenicians yet, the "out of stock" condition in their inventory system would ultimately lead to the downfall of the Empire.
5
60
u/stupergenius May 12 '20
Hot off the presses: Out-of-date, insecure open-source code is everywhere.
4
u/BibianaAudris May 13 '20
The point is, including an outdated vulnerable version of libpng to read internal PNG files won't be exploitable. I'd imagine most of the vulnerable instances are such harmless ones.
2
3
May 12 '20
until the penalties outweigh the costs of securing code it's a pointless conversation
10
2
May 13 '20
unfortunately large companies prefer to ignore or just insure themselves against losses arising out of hacks, instead of funding fundamental research and development
1
May 13 '20
Although portrayed as news, this is not a new problem in software development - managing dependencies is quite an important aspect of software architecture. Any decision to use code or binaries written by someone else should be properly documented, with all implications. Any security flaw in a dependency translates to security flaws in your product.
I hope everyone remembers how the internet was broken when a certain package was removed by its author from npm (https://qz.com/646467/how-one-programmer-broke-the-internet-by-deleting-a-tiny-piece-of-code/). While the root cause itself has been addressed since then, the issue of managing dependencies remains - is it worth putting your application/system at risk by using someone else's 11 line of code for left padding?
In any piece of software worth anything, commercial or otherwise, is it justifiable not to invest the time to write your own code for trivial functions not offered by your language/technology of choice?
1
1
1
1
u/Y_Less May 13 '20
It doesn't help when new versions fix security bugs and change half the API at the same time. So to upgrade the dependency you have to change your code to do exactly the same thing against their new design. Or you just leave it.
1
u/dnew May 13 '20
Makes me wonder how many of those code bases are in COBOL. Are there even FOSS COBOL repositories around?
thinks we need a software bill of materials (BOM).
That's called a makefile. Or a repository.
0
May 13 '20
[deleted]
2
u/omegian May 13 '20
Great. So it would have 816 dead links to expertsexchange forum posts.
2
u/t3h May 13 '20
I love how that site was basically StackOverflow long long before StackOverflow but since it insisted on the payment of a membership fee to participate, it never really went anywhere...
Also, it had a name with much more misreading potential.
1
18
u/TomOwens May 12 '20
I'm not surprised. I haven't seen personally or even read/heard about anyone with any kind of rigor regarding evaluating open source software components for suitability and then following through with monitoring for vulnerabilities, updates, and operational concerns. Once you've selected a library, it's not just security problems to watch out for, but cases where the library simply stops being maintained or is replaced by something else. All of these represent technical debt in the system under development.