Repository navigation
fix(binary): correct traefik version detection on big-endian arches - #5281
Merged
Merged
Conversation
The traefik-binary classifier regex required a NUL byte or replacement character immediately before the version string. On some architectures (e.g. s390x), the real version string in the binary has no such prefix, so the classifier instead matched an earlier, unrelated NUL-prefixed numeric string elsewhere in the binary (e.g. '2.7.0' from an unrelated printf-style format constant), producing an incorrect version. This adds an additional pattern, tried first via MatchAny, that matches version strings terminated by two NUL bytes without requiring a NUL prefix. The original pattern remains as a fallback for older traefik binaries (e.g. v1.x) that use single-NUL termination. Fixes anchore#4980 Signed-off-by: Mayank Sekhar <mayankshekharsingh@gmail.com>
wagoodman
approved these changes
Sep 23, 2026
wagoodman
enabled auto-merge (squash)
September 23, 2026 13:59
spiffcs
added a commit
that referenced
this pull request
Sep 30, 2026
* main: (91 commits) feat: catalog CPAN distributions installed by perl clients (#5131) fix(binary): correct traefik version detection on big-endian arches (#5281) Fix hang when scanning a Java resource adapter (.rar) file (#5348) chore(deps): update SPDX license list (#5315) fix: match opensource.org license URLs across SPDX URL forms (#5361) Speed up unit tests in CI (#5360) Fix missing file hashes when running on windows system (#5341) Stop reading the mount table for every single-file source (#5257) fix: conan expat CPE (#5259) fix(spdx): write a name for the root package when the source has none (#5349) fix(python): link uv.lock dependents to the locked version they name (#5351) fix: suppress misleading upstream CPE for PHP extension binaries (#5102) fix: report scanner errors and raise the line cap in metadata parsers (#5353) Harden cataloger parsers against truncated input (do not panic) (#5355) fix(cpe): bound CPE candidate generation for pathological package metadata (#5356) test(golang): make the UPX fixture exercise loader padding (#5354) fix(golang): account for UPX's loader padding when unpacking Go binaries (#5347) test(snap): bound the kernel changelog bomb fixture by ratio, not a fixed 1MB (#5352) test(debian): bound the bomb fixture by ratio, not a fixed 1MB (#5350) fix(ai): handle malformed GGUF headers without panicking (#5345) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #4980 (partially covers the s390x false-positive; arm/v6 was also broken but the root cause and fix are the same).
The traefik-binary classifier regex required a NUL byte or replacement character immediately before the version string. On some architectures (e.g. s390x), the real version string in the binary has no such prefix, so the classifier instead matched an earlier, unrelated NUL-prefixed numeric string elsewhere in the binary (e.g. '2.7.0' from an unrelated printf-style format constant), producing an incorrect version.
This adds an additional pattern, tried first via MatchAny, that matches version strings terminated by two NUL bytes without requiring a NUL prefix. The original pattern remains as a fallback for older traefik binaries (e.g. v1.x) that use single-NUL termination.
The bug
The traefik-binary classifier's regex required a NUL byte or Unicode replacement character immediately before the version string. On some architectures (observed on s390x), the real version string has no such prefix, so the classifier instead matched an earlier, unrelated NUL-prefixed numeric string elsewhere in the binary (e.g.
2.7.0from an unrelated printf style format constant) producing a wrong, stale version regardless of the actual traefik version.The fix
Added a second pattern, tried first via
MatchAny, that matches version strings terminated by two NUL bytes without requiring any prefix.MatchAnystops at the first matcher that finds anything, so this new pattern takes precedence when it applies, while the original single-NUL pattern remains as a fallback for older traefik binaries (v1.x) that use single-NUL termination.Verification
traefik:3.6.8(s390x) andtraefik:v2.11.1(arm/v6) binaries from the images referenced in the original issue and confirmed the previous regex mismatched on s390x while the new one correctly resolves both.traefiktest subset passes (7/7), including the pre-existing v1.7.34/2.9.6/2.10.7/3.0.4/3.6.5 cases confirming no regression.juliatest failures were confirmed to exist identically on a cleanmaincheckout (unrelated to this change).Type of change
Fix Merge
Checklist
Issue references
#4980