fix(binary): require gzip identity evidence in gzip classifier

Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
This commit is contained in:
Christopher Phillips 2026-08-13 13:35:48 -04:00
parent 68da404bd7
commit 83dfbcc24a
No known key found for this signature in database
3 changed files with 6 additions and 0 deletions

View File

@ -898,7 +898,13 @@ func DefaultClassifiers() []binutils.Classifier {
{
Class: "gzip-binary",
FileGlob: "**/gzip",
// GNU gzip assembles its version banner at runtime from argv[0], so the version is stored as a
// bare NUL-delimited token with nothing to anchor against. Require a gzip-specific string
// elsewhere in the file before trusting that token, otherwise any binary reachable by a path
// named "gzip" (such as the busybox multicall binary, which provides a gzip applet by symlink)
// is reported as GNU gzip with an arbitrary version.
EvidenceMatcher: m.FileContentsVersionMatcher(
`not in gzip format|bug-gzip@gnu\.org|GZIP environment variable`,
`\x00(?P<version>[0-9]+\.[0-9]+)\x00`,
),
Package: "gzip",

Binary file not shown.