In a LinkedIn comment on “My thoughts on the current effects of AI on OSS security” from last week, I got a great question. The question came from someone working with a European government that has faced attacks. This has led some, he says, to advocate for closed software instead of open source software. He wanted to know if there is a proven higher risk for open source software.
I am trying to advocate in favor of shared defense systems and teams for open source gov repos. Transparency and reusability won’t be enough to justify keeping projects open if AI (humans behind it) is indeed targeting those repos first.
My initial response was longer than LinkedIn allows, so I have him a short answer and promised a follow up post. This is the follow up post.
The arguments
For the sake of completeness, I am going to spend a moment on the case for and against openness when it comes to security. If you’re already familiar with this, you can skip ahead to the next section.
The case for keeping source code closed boils down to “if the bad guys can’t see the code, it’s harder for them to find vulnerabilities.” The term used for this is “security by obscurity”, usually said derisively. There is some merit to that, though. Keeping the source code out of an attacker’s hands won’t prevent attack, but it can present a speed bump. Locking your front door won’t stop a determined person from entering your home, but it’ll make most burglars move on to an unlocked house.
On the other hand, having the source code available also means that good actors can also look for weakness. This is the idea behind Eric Raymond’s “given enough eyeballs, are bugs are shallow” aphorism. And if the source is not just available, but modifiable (as all free and open source software licenses permit), then more people can fix vulnerabilities, too.
The question comes down to: which effect is greater? Surprisingly, this question isn’t particularly well-studied. Very little academic literature existed when I worked on my M.S. thesis 12–15 years ago. I haven’t found much published since. In 2010, Guido Schryen and Eliot Rich found (PDF) “open source and closed source software do not differ significantly in terms of the severity of vulnerabilities and vendors’ patching behavior.”
And now?
I am not aware of any evidence that suggests the math has changed for open source projects. The same factors are still at work now. On the one hand, adversarial actors can examine the code directly instead of reverse engineering binaries, making it easier to find weaknesses. On the other hand, good actors can do the same. And there are still more people who can examine the open code than the closed. Nothing’s new; it’s just faster.
Where it gets particularly interesting is in the form of attack. By and large, attackers aren’t trying to sneak malicious code into a project’s GitHub repo. Instead, they’re exploiting weaknesses in build pipeline configurations and compromising credentials. That’s a much more effective approach, but it’s also relatively easy to guard against.
Thinking about it from the software consumer perspective, the transparency argument is more important than the question gave it credit for. I can go to a GitHub repo and look at a project’s workflow configuration. I can look at the output of the Action that produced a build. I can verify that it is what it is claims to be. On the other hand, if it’s a closed system then you have to take the provider’s word for it. When attackers compromised Trivy earlier this year, people knew — and reacted — very quickly. The SolarWinds compromise lasted for months.
So consumers of software should prefer open source (and openly-developed — they’re different) software. Producers of software should then prefer to openly-develop open source software, since that’s what software consumers want. Producers should, of course, take reasonable steps to secure their software and their software development practices. Frameworks like the OSPS Baseline, SLSA, and others give consumers of software the auditability and trust they need to secure their usage of software.
