Skip to content

Fix Traefik version detection across architectures#5052

Open
ychampion wants to merge 1 commit into
anchore:mainfrom
ychampion:fix-traefik-version-classification
Open

Fix Traefik version detection across architectures#5052
ychampion wants to merge 1 commit into
anchore:mainfrom
ychampion:fix-traefik-version-classification

Conversation

@ychampion

@ychampion ychampion commented Jul 10, 2026

Copy link
Copy Markdown

Summary

Fix Traefik binary version detection for release builds whose version data is not NUL-prefixed.

Motivation

Recent amd64, arm/v6, ppc64le, and s390x binaries are missed or can be reported as a dependency version such as 2.7.0. Closes #4980.

Changes

  • Prefer version data terminated by multiple NUL bytes, then fall back to legacy layouts.
  • Add digest-pinned release fixtures for four affected architectures.
  • Cover the s390x dependency-version ordering regression.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change
  • Documentation
  • Chore
  • Performance

Validation

  • go test ./syft/pkg/cataloger/binary -run '^Test_Cataloger_PositiveCases$/^traefik/' -count=1
  • go test ./syft/pkg/cataloger/binary -run '^TestTraefikClassifierPrefersVersionData$' -count=1
  • go test ./syft/pkg/cataloger/binary/internal/manager/... -count=1
  • go vet ./syft/pkg/cataloger/binary ./syft/pkg/cataloger/binary/internal/manager/...
  • Complete release binaries passed with -must-use-original-binaries for amd64 2.11.30, arm/v6 3.6.6, ppc64le 2.11.10, and s390x 2.10.5.
  • The unrelated Docker-backed Java/ELF/PE package suite was not completed locally because its image fixtures exceeded available disk.

Checklist

  • I have added unit tests that cover changed behavior
  • I have tested my code in common scenarios and confirmed there are no regressions
  • I have added comments to hard-to-understand sections

Constraint: Preserve legacy single-NUL layouts while preferring multi-NUL version data.

Confidence: high

Scope-risk: narrow

Tested: Traefik snippet cases; amd64, arm/v6, ppc64le, and s390x release binaries; manager tests; go vet
Signed-off-by: ychampion <ychampion@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support traefik binary various versions

1 participant