Comments (6)
Hi @jonjohnsonjr, thanks for offering to help with this!
The code changes to make are really in Syft. Essentially, Syft should make 2 changes:
- The metadata Syft emits about Go packages should include what experiments are enabled, so that this information isn't lost
- Syft should trim the stdlib / go version to a valid semver version (remove the space and everything after.)
The definition of the Go package metadata is here: https://github.com/anchore/syft/blob/6107e5e2ad6e60f3f74ff4d3b2ca2ccffbed26ed/syft/pkg/golang.go#L4 - this definition likely needs new fields to hold information about the experiments, and then they need to be populated.
The function that scans the go binary for build info and other information is here: https://github.com/anchore/syft/blob/3023a5a7bc870f70a3dd24213d795516288ca0df/syft/pkg/cataloger/golang/scan_binary.go#L22 - I'm not certain exactly the right factoring for where we should trim the version info and capture the metadata, but this function is in the neighborhood.
Happy to discuss further! Please let me know if you have any questions.
from grype.
Hi @jonjohnsonjr, thanks for the report! It looks like today we take that field as-is but we need to probably parse out the flags after the X:. We might need to find a place to record those flags somewhere. We'll put this in the backlog for a fix. Let us know if you're interested in working on it and we can help get you started.
from grype.
Just adding an explicit note that this causes false negatives, too. The Go stdlib usually accounts for a large surface area in vuln-matching a Go binary, so situations where Grype doesn't take the stdlib into account would mean missing any number of vulns if Go experiments are used. Also IIUC there are worlds where using Go experiments is much more common, such as to support FIPS.
from grype.
Let us know if you're interested in working on it and we can help get you started.
I can take a stab at it if you can point me in the approximate direction 🙏
from grype.
Opened a PR in syft: anchore/syft#2893
I'm honestly not sure how necessary it is given that grype
seemed to find the CVEs associated with stdlib even without my "fix", but maybe you'd have a better idea.
from grype.
Fix for this was included in #1897
from grype.
Related Issues (20)
- vex: Add package name to VEX product identifiers HOT 1
- False positive: GHSA-h4m5-qpfp-3mpv (CVE-2021-42771) in SLES 15.5
- False positive: GHSA-43fp-rhv2-5gv8 (CVE-2022-23491), GHSA-xqr8-7jwr-rhp7 (CVE-2023-37920) python3-certifi in SLES 15.5 Ecosystem
- grype db diff consumes lots of memory HOT 1
- FP CVE-2024-20932 on jdk8 HOT 2
- Add `--from` flag
- Deduplicate vulnerabilities for SUSE linux
- Exit with a different return code for a failed scan HOT 1
- False positive: GHSA-v973-fxgf-6xhp (CVE-2022-40023) in SLES 15.5 Ecosystem
- False positive: GHSA-qwmp-2cf2-g9g6 (CVE-2022-40898) in SLES 15.5 Ecosystem
- False positive: GHSA-v3c5-jqr6-7qm8 (CVE-2022-40899) in SLES 15.5 Ecosystem
- False positive: GHSA-w596-4wvx-j9j6 (CVE-2022-42969) in SLES 15.5 Ecosystem
- Remove wordpress mentions in false positive list HOT 2
- Prefer direct match information over indirect matches HOT 5
- Look at package rebuild info on advisories for indirect matches HOT 2
- False positive: GHSA-x4qr-2fvf-3mr5 (CVE-2023-0286) in SLES 15.5 Ecosystem but trigger by cryptography
- False positive: GHSA-xg9f-g7g7-2323 (CVE-2023-25577) python3-Werkzeug in SLES 15.5 Ecosystem
- False positive: GHSA-m2qf-hxjv-5gpq (CVE-2023-30861) python3-Flash in SLES 15.5 Ecosystem
- Can you control the internal format used by Syft when scanning a directory? HOT 3
- grype db is not being downloaded HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grype.