Repository navigation
Conversation
Windows VERSIONINFO string tables often carry the .rc-style comma-separated form of a version (mirroring FILEVERSION 3,0,21,0), so binaries such as VLC report a version of "3, 0, 21, 0". That value was used verbatim as the package version, which produced identifiers like cpe:2.3:a:...:3\,0\,21\,0 that match nothing in vulnerability data. Normalize values that consist entirely of comma-separated numbers into the canonical dotted form; anything else (including versions with a trailing comment) is left untouched. Signed-off-by: Eljees <3.14hell@gmail.com>
|
Ping on this one and #5114 - both open since late July, no review yet. They touch different areas (binary PE version resources and the CycloneDX decoder) and are independent. |
The first version of this change only rewrote values that consisted entirely of comma-separated numbers, which missed the spelling that is most common on Microsoft-built binaries: "1, 0, 0, 1 (WinBuild.160101.0800)". Those kept their commas and still produced a version that matches nothing. Rewrite a leading run of comma-separated numbers instead and leave whatever follows it untouched, so that form becomes "1.0.0.1 (WinBuild.160101.0800)" and is then treated exactly like the dotted "10.0.19041.1 (WinBuild.160101.0800)" that reaches this function today. A value that does not begin with such a run is still returned unchanged. Signed-off-by: Eljees <3.14hell@gmail.com> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015CsUTRwsaFCwavDJTPwEpW
|
Pushed a follow-up commit ( The original change only rewrote values that were entirely comma-separated numbers. That misses the spelling most common on Microsoft-built binaries, where a build tag follows the version. Measured on
The fix is to rewrite a leading run of comma-separated numbers and leave the rest of the string alone, rather than requiring the whole value to match. The deliberate boundary: Two test cases were added for the new rows; the existing ones are unchanged and still pass. Verification, since the branch was cut in August: it merges into current 🤖 Generated with Claude Code |
Bring in the upstream Busybox fixture digest pin and sigstore bundle installer verification updates. Preserve the PE version normalization source and regression tests unchanged. Signed-off-by: Eljees <3.14hell@gmail.com> Assisted-by: OpenAI Codex
Summary
Normalizes the comma-separated version form found in Windows PE
VERSIONINFOresources, so3, 0, 21, 0becomes3.0.21.0.Why
Windows resource string tables frequently mirror the
.rcdeclaration (FILEVERSION 3,0,21,0) rather than the dotted form. Syft used that value verbatim as the package version, which is visible in #5075 — VLC is reported as:A version containing escaped commas matches nothing in vulnerability data, and the same value flows into the PURL and the package version shown to users.
This only addresses the version portion of that issue; the vendor/product naming discussion there is separate and left alone.
Details
extractVersionFromResourcesValuenow normalizes a value that consists entirely of comma-separated numbers (with optional surrounding spaces) to the dotted form.1.2.3 (build 456)keep their existing handling and a value such as1.0, betais not rewritten.Tests
Added
Test_findVersionFromVRcovering dotted input, both comma-separated forms (3, 0, 21, 0and3,0,21,0), a version with a trailing comment, and a non-numeric comma value.go test ./syft/pkg/cataloger/binary/passes.