-
Notifications
You must be signed in to change notification settings - Fork 575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
false positives in logstash image #816
Comments
Thanks for the issue @kingjs10. I'm working on a few other issues at the moment, but I made sure to give this the correct false positive label so that we can keep track of why some of these vulnerabilities are being incorrectly flagged. |
Thanks @kingjs10 for reporting this issue. I'm going to see what parts of it can still be reproduced, since several false positives are reported.
prints the following vulnerabilities:
Let's gather some more details on each of them: CVE-2019-5477 from https://nvd.nist.gov/vuln/detail/CVE-2019-5477
URLs:
CVE-2022-0543 from https://nvd.nist.gov/vuln/detail/CVE-2022-0543
URLs:
This comment is long, but I'll try to do a little digging on why we're not regarding the version number for the nokogiri jar. It looks like some things have been upgraded in the image since the original comment as well. So the remaining questions I have are:
|
Taking the second question first, let's try to see what flavor of Linux this logstash image is based on:
prints
So the image is built from Ubuntu, so it's not unreasonable to think that a Debian packaging vulnerability affects it. Additionally, https://packetstormsecurity.com/files/166885/Redis-Lua-Sandbox-Escape.html, which is one of the related URLs from the CVE, says:
So we'll need to do some digging to see which version of Ubuntu may have fixed this. https://nvd.nist.gov/vuln/detail/CVE-2022-0543#match-7772249 lists debian 9.0, 10.0, and 11.0, but I'm not sure which versions of Ubuntu may have the fix. Edit: It looks like, assuming https://askubuntu.com/a/445496 is correct, that Ubuntu Focal Fossa is based on Debian 10. |
The nokogiri one is interesting; I'm not sure what to make of it. Running:
Prints: This seems clearly to be a false positive, for a couple of reasons: 1. The version of nokogiri present is 1.13.10, but the issue was fixed in nokogiri 1.10.4, and the artifact reported as vulnerable is the jruby implementation of nokogiri.jar, which (probably?) doesn't have the same vulnerabilities as the normal ruby interpreter's The purl we generated, I'm really not sure how we ought to handle JRuby gems, since they aren't clearly the responsibility of the Java matcher or the Ruby matcher. The other false positives reported in @kingjs10 's original post don't seem to appear any more; I'm not sure whether they were fixed in grype, or the image tag moved. |
What happened:
Image from opensearch/elastic shows false positives
https://hub.docker.com/r/opensearchproject/logstash-oss-with-opensearch-output-plugin
CVE-2014-9390
"path": "/usr/share/logstash/vendor/bundle/jruby/2.5.0/specifications/git-1.9.1.gemspec"
CVE-2015-7545
"path": "/usr/share/logstash/vendor/bundle/jruby/2.5.0/specifications/git-1.9.1.gemspec"
CVE-2016-2324
"path": "/usr/share/logstash/vendor/bundle/jruby/2.5.0/specifications/git-1.9.1.gemspec"
CVE-2018-19486
"path": "/usr/share/logstash/vendor/bundle/jruby/2.5.0/specifications/git-1.9.1.gemspec"
CVE-2019-5477
"path": "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/nokogiri-1.12.5-java/lib/nokogiri/nokogiri.jar"
Vulnerable version is v1.10.3, this is version 1.12.5
https://github.com/sparklemotion/nokogiri/releases/tag/v1.12.5
https://nvd.nist.gov/vuln/detail/CVE-2019-5477
CVE-2022-0543
"path": "/usr/share/logstash/vendor/bundle/jruby/2.5.0/specifications/redis-4.5.1.gemspec"
CVE-2022-25648
"path": "/usr/share/logstash/vendor/bundle/jruby/2.5.0/specifications/git-1.9.1.gemspec"
GHSA-69p6-wvmq-27gg
"path": "/usr/share/logstash/vendor/bundle/jruby/2.5.0/specifications/git-1.9.1.gemspec"
GHSA-h99w-9q5r-gjq9
"path": "/usr/share/logstash/vendor/bundle/jruby/2.5.0/specifications/puma-5.5.2-java.gemspec"
What you expected to happen:
gemspec files shouldn't be flagged
How to reproduce it (as minimally and precisely as possible):
grype opensearchproject/logstash-oss-with-opensearch-output-plugin
Anything else we need to know?:
CVE-2019-5477
"path": "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/nokogiri-1.12.5-java/lib/nokogiri/nokogiri.jar"
is picked up even though it's not the correct version
Environment:
grype version
:➜ ~ grype version 16:00:20
Application: grype
Version: 0.40.1
Syft Version: v0.49.0
BuildDate: 2022-06-24T18:56:01Z
GitCommit: 82c0146
GitDescription: v0.40.1
Platform: darwin/arm64
GoVersion: go1.18.3
Compiler: gc
Supported DB Schema: 3
cat /etc/os-release
or similar):Darwin computername 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:46:32 PDT 2022; root:xnu-8020.101.4~15/RELEASE_ARM64_T6000 arm64
The text was updated successfully, but these errors were encountered: