Skip to content
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

syft shows (devel) version for git-lfs while git-lfs version command shows 3.6.0 #3588

Open
Bruceliu-rs opened this issue Jan 15, 2025 · 4 comments
Labels
bug Something isn't working needs-investigation

Comments

@Bruceliu-rs
Copy link

Bruceliu-rs commented Jan 15, 2025

What happened:
syft generated git-lfs library with 'devel' version number, which was reported in DT(Dependency Track) as vulnerability.

image

syft scan f96bcfd2281c --select-catalogers "go"

github.com/git-lfs/git-lfs/v3 (devel) go-module

What you expected to happen:
It should show 3.6.0 like the git lfs version command
git lfs version
git-lfs/3.6.0 (GitHub; linux amd64; go 1.23.3; git 6340befc)
Steps to reproduce the issue:
docker pull docker.io/jenkins/jenkins:2.493
syft scan jenkins/jenkins:2.493 --select-catalogers "go"

docker run -u root -it 03347633fbe6 /bin/bash

git lfs version

Anything else we need to know?:
The jenkins docker image is from Debian bookworm release.

Environment:

@Bruceliu-rs Bruceliu-rs added the bug Something isn't working label Jan 15, 2025
@spiffcs
Copy link
Contributor

spiffcs commented Jan 15, 2025

👋 thanks for the issue @Bruceliu-rs - I've added a comment from another issue that explains why this might be the case when syft fails to find the version.
#2980 (comment)

This issue is also related:
#3324

@Bruceliu-rs
Copy link
Author

Bruceliu-rs commented Jan 16, 2025

Hi @spiffcs , thanks for the confirmation, so I guess we need to wait for go 1.24 release, which is planned to release Feb 2025, two weeks later. I can wait. :)

@spiffcs
Copy link
Contributor

spiffcs commented Jan 23, 2025

Yea - that doesn't guarantee that when it comes out binaries built with previous compilers will have the version information, but as newer code get's released and 1.24 becomes an "older" version that people have updated to and surpassed you should see the percentage of binaries with this information embedded increase over the course of the year.

I've bookmarked this issue so we're ready for it in syft and can get a release to match that functionality as soon as it's available

@wagoodman
Copy link
Contributor

Based off of what I'm seeing this would be tricky to try and make a stable pattern for this. Take this, which is an installation from brew of git-lfs:

00509c50: 732e 7061 7274 5261 6e67 6562 6174 6368  s.partRangebatch
00509c60: 7369 7a65 3d69 643d 2573 312e 302e 3050  size=id=%s1.0.0P
00509c70: 4154 4348 2020 5b50 5d20 205b 4c5d 2573  ATCH  [P]  [L]%s
00509c80: 0925 7353 6c69 6365 4172 7261 7925 7320  .%sSliceArray%s
00509c90: 2573 756d 6173 6b67 726f 7570 5f4e 414d  %sumaskgroup_NAM
00509ca0: 4545 4d41 494c 2020 2573 0a33 2e36 2e31  EEMAIL  %s.3.6.1
00509cb0: 6361 6368 6570 6174 683d 2573 3a25 782d  cachepath=%s:%x-
00509cc0: 3037 3030 2573 4025 7325 763a 2576 7072  0700%s@%s%v:%vpr
00509cd0: 6f78 7966 696c 6573 6874 7470 7369 6d61  oxyfileshttpsima
00509ce0: 7032 696d 6170 3369 6d61 7073 706f 7033  p2imap3imapspop3
00509cf0: 7368 6f73 7473 434e 414d 4572 6f75 7465  shostsCNAMEroute

Here you can see 3.6.1 embedded into the middle of this output, but notice the surrounding random symbols, and the fact that there are no padding nulls to separate values from one another. It is possible to make a regex for this, but I don't imagine it to be stable between builds of different versions.

If anyone sees any good options here in terms of being able to parse a version from this, thoughts are welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-investigation
Projects
Status: No status
Development

No branches or pull requests

4 participants