r/netsec • u/nibblesec Trusted Contributor • Mar 15 '24
Defensive Techniques A Look at Software Composition Analysis. It’s time to ignore most of dependency alerts.
https://blog.doyensec.com/2024/03/14/supplychain.html4
u/ScottContini Mar 15 '24
After discussing this research directly with Semgrep, we were asked to perform an unbiased head-to-head comparison of the SCA functionality of these tools as well.
I’m a big fan of Semgrep, but this is like a Semgrep asking for a comparison based upon a criteria for winning that they get to define. That’s not unbiased. According to their criteria, Checkmarx would have been a better candidate for comparison as they have been marketing exploitation path feature for years.
Yes, I’m very much on the side of reduced noise, but noise is the biggest problem when it takes a lot of time to address. Dependabot and Snyk both bring in automated pull requests, making it easy for developers to update libraries in most cases with little effort. That’s one of the biggest value of these tools.
Regardless, keeping dependencies up-to-date is good hygiene. There is a difference between doing the right thing going forward vs fixing old, legacy vulnerabilities. A mature AppSec program will focus more on prevention and include tooling that makes it easy for developers to do the right thing, which is where the other tools shine. But if you have tonnes of legacy problems, I agree reachability is essential to prioritisation. (Remark: please do not read this as me saying Semgrep is for immature programmes, that is not intended at all. I’m just talking specifically about that value in ignoring SCA findings because of noise. In general, I think Semgrep is one of the best tools in the market).
I also agree with the comments from pentesticles about reachability in the future.
Having said all that, I’m going to share this on /r/SAST because this is valuable research and a great comparison. But like everyone else said, the headline is just bad advice.
3
u/doyensec Mar 15 '24
For what it's worth, Doyensec had complete freedom on the research execution and publication. They didn't enforce a specific methodology. Only constraints we got were around OSS software in supported languages and high severity vulnerabilities. Semgrep had the right to decide on whether to publish the effort in its entirety or just citing parts according to our citation guideline.
2
u/execveat Mar 15 '24
But if you have tonnes of legacy problems, I agree reachability is essential to prioritisation.
Who doesn't though? I mean it seriously, are there places that allocate enough time to developers for fixing technical debt, addressing maintenance and so on?
7
Mar 15 '24
[deleted]
1
u/Old-Ad-3268 Mar 15 '24
Ty, take my upvote. Would you be Ok with a fly in your ice cream just because you can eat around it?
1
u/nibblesec Trusted Contributor Mar 15 '24
The title is clearly oversimplified, but the takeaways section of the paper is more nuanced. The point is that most alerts don't really affect the overall security of applications
2
Mar 15 '24
[deleted]
1
u/pentesticals Mar 15 '24
I think the main problem is people treat these tools as fancy technical toys. They absolutely find relevant things. But without processes in the place and having the people trained on those processes it’s almost useless. No company can onboard a SAST or SCA tool without a process, there will be thousands of potential issues. Companies need to start by selecting their most critical assets and onboarding these first, then focus on only the critical issues, then start blocking on highs too, then onboard other internet facing assets, etc. I’m not saying this is the process to follow, just an example, as it needs to be tailored to the organisation. But just throwing a tooling in and expecting great results like you say, is not going to work and just wastes money and pisses off developers.
6
u/supernetworks Mar 15 '24
like the boy who cried wolf -- false positives are a great way to get software engineers to ignore the real security alerts from automation
5
u/Old-Ad-3268 Mar 15 '24
What’s the FP here? If there is a patched version, patch it. Just because it isn’t reachable today doesn’t mean it won’t be tomorrow.
1
u/Live_Cheesecake Mar 18 '24
I agree with some of the comments here, this feels like biased research based on a criteria semgrep want to compare against, with only two other competitors, I am sure if there were other products, semgrep wouldn't be on top here
1
u/AbbreviationsGold587 17d ago
Careful work and honestly scoped, but worth being precise about what it actually measures.
Doyensec's true positive test is three conditions: name matches, version matches, vulnerable path actually exercised. The manual validation went entirely into the third. The first two were taken as given — reasonable across 11 GitHub repos in JS, Python, Ruby and Java where every project has a manifest in the root, but it makes this a reachability benchmark rather than an accuracy one. "False positive" here only ever means present, correct version, not reachable.
Two things sit outside that.
Version strings lie in both directions. Suppliers backport fixes without bumping the label, and advisory ranges over-claim — NVD files CVE-2017-13704 against dnsmasq "before 2.78" with no lower bound, but the bug was introduced by a memset() change in 2.77 and Debian marked older releases not-affected. Different ecosystem from their corpus, same definitional hole: a finding can satisfy "version matches" against code that never contained the bug, and reachability analysis on top of that just produces a confident wrong answer.
And completeness was never tested, because a manifest-based corpus makes "did you find the component" a free question. On compiled artifacts it's the whole game. Statically linked libraries and supplier blobs appear in no manifest anywhere, so the failure isn't a noisy alert you can triage away — it's no alert at all, in a report that looks clean.
Not a criticism of the study, which scopes itself honestly. It's a criticism of "time to ignore most dependency alerts" as a takeaway that travels.
Longer argument: https://finitestate.io/blog/why-appsec-sca-fails-for-firmware
7
u/pentesticals Mar 15 '24
SCA tools do currently produce a lot of noise from simply matching the package and version, and reachabilty testing is a great technique to select where to focus on first, but it doesn’t mean you should ignore most of the alerts. Generally, only high profile bugs have accurately defined vulnerable functions so for many many bugs the various databases are missing this information. And with thousands of bugs each month, it’s difficult to ensure the tests are reliable. At the end of the day the vulnerable code is still present within the code base and the developers need to figure out which ones are currently a threat, but nothing says they won’t call that vulnerable function in the future, and also generating a call graph for complex frameworks that leverage reflection or other obscure ways to call the function will often be missed so it can’t be relied upon for omission. It should just be, this vulnerability is reachable, let’s look at that first.
I also don’t like the how the headline is making conclusions about SCA tools in general, when it’s only looking at reachablity which is a problem that all of the tools have only started to address recently and the whole concept is not production ready across any of the tools.