-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Anchore grype EPSS fix #12825
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
Anchore grype EPSS fix #12825
Conversation
This pull request contains a potential information disclosure vulnerability in the Anchore Grype parser, where debug logging may expose sensitive system details such as file paths, software component information, and vulnerability specifics, which could be exploited by an attacker if debug logs are enabled in non-development environments.
Information Disclosure via Debug Logging in
|
Vulnerability | Information Disclosure via Debug Logging |
---|---|
Description | The line logger.debug(f"data: {data}") logs the entire content of the parsed JSON file from the Anchore Grype scan. This data includes sensitive information such as internal file paths (artifact.locations.path ), precise software component names and versions (artifact.name , artifact.version ), and detailed vulnerability information (IDs, descriptions, CVSS/EPSS scores). Logging this comprehensive data, even at a debug level, poses a significant information disclosure risk if debug logs are enabled or accessible in a non-development environment. An attacker could use this information to map the system's attack surface and identify specific vulnerabilities to exploit. |
django-DefectDojo/dojo/tools/anchore_grype/parser.py
Lines 30 to 38 in 42f319f
) | |
def get_findings(self, file, test): | |
logger.debug(f"file: {file}") | |
data = json.load(file) | |
logger.debug(f"data: {data}") | |
dupes = {} | |
for item in data.get("matches", []): | |
vulnerability = item["vulnerability"] |
All finding details can be found in the DryRun Security Dashboard.
287386c
to
42f319f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
👋 Hey all! A team member at Anchore mentioned this PR to us over in our tools discussion and I thought I would chime in here to maybe give some Grype knowledge on the thread. I saw this was approved already, but hopefully this comment clarifies the orientation of results and how we do the EPSS data. Let's start with an example we can all follow along that gives examples of the data shape we want to inspect:
This isn't the best scan target for a "real" vulnerability scan, but because grype has lots of test cases locally that will display a good number of findings it is a good way to look at some example data. So the first thing we can look at this result is by default how many GHSA results did we get here?
This PR correctly identifies that you can find the related cve(s) if they exist under the related vulnerabilities field for the given GHSA result:
Grype has another option though where you can orient Let's run our example scan again to see how many GHSA we get when we include this option.
Note here that we didn't totally eliminate GHSA from the list since there will be some entries from the GHSA DB that don't have a related CVE. Your milage may also vary based on scan targets as far as absolute number of results when enabling this option. The links between NVD --> GHSA and vise versa are not always 1:1. A GHSA might have multiple CVE linked. This would mean that a scan result where we orient around CVE could expand the absolute number of vulnerability results when a single GHSA that covers multiple related CVE was presented as the top level result. I haven't had time to look at the full PR chain here regarding how defect dojo is integrating grype, but my guess is that if you're looking for CVE --> EPSS/KEV data in the most streamlined JSON result then Happy to answer other questions or take a look at specific examples where we might have to make changes or update grype! |
Thanks for the fix @valentijnscholten - apologies for the oversight in my original PR! And thanks for the insight @spiffcs - I'll soon be relying on DD + Grype with EPSS data going forward so I'll report cases when they arise. Maybe we'll see it in action at the "Using Anchore & DefectDojo to Stand Up Your DevSecOps Function" webinar... |
Thank you @spiffcs for jumping in. Should we add some notes to our anchore grype docs to advise users to use the |
👋 @valentijnscholten - I'd say you can update the docs to show that The first point of that issue should be fixed soon when we get some of our fixed in dates updated. I would highlight these points from the issue as potential side affects to orienting by this view:
|
I think with the fix for the EPSS in place there's no real reason to instruct users to use the |
Fixes #12819
When the original vulnerability id is not a CVE, the parser must look harder in the related vulnerability data to find the EPSS data.
This might not be a 100% complete fix as for that the parser needs to be changed to parse all related vulnerabilities instead of just the first one. Anyone with Grype knowledge please advise :-) For now this at least fixes the one known problem case.