Skip to content

fix: add facebook as additional CPE vendor for react npm package#4682

Open
dreamcreated wants to merge 1 commit intoanchore:mainfrom
dreamcreated:fix/react-cpe-vendor
Open

fix: add facebook as additional CPE vendor for react npm package#4682
dreamcreated wants to merge 1 commit intoanchore:mainfrom
dreamcreated:fix/react-cpe-vendor

Conversation

@dreamcreated
Copy link

Summary

Fixes #4653

The NVD uses facebook as the vendor for React in CPE identifiers:

cpe:2.3:a:facebook:react:<version>:*:*:*:*:*:*:*

Syft was generating react as the vendor:

cpe:2.3:a:react:react:<version>:*:*:*:*:*:*:*

This caused failures in vulnerability matching tools like DependencyTrack because the generated CPE did not match the NVD canonical form, preventing CVE matching for React packages.

Changes

  • Added react to defaultCandidateAdditions in candidate_by_package_type.go with AdditionalVendors: ["facebook"]
  • Added regression tests in TestGeneratePackageCPEs and TestCandidateVendor that verify the facebook vendor is included

Testing

go test ./syft/pkg/cataloger/internal/cpegenerate/... -run "TestGeneratePackageCPEs/react|TestCandidateVendor/react"

All existing tests pass.

References

The NVD uses 'facebook' as the vendor for React in CPE identifiers:
  cpe:2.3:a:facebook:react:<version>:*:*:*:*:*:*:*

Syft was generating 'react' as the vendor, which caused failures in
vulnerability matching tools like DependencyTrack because the generated
CPE did not match the NVD canonical form.

Fixes anchore#4653

Changes:
- Add react to defaultCandidateAdditions with AdditionalVendors: ["facebook"]
- Add regression tests in TestGeneratePackageCPEs and TestCandidateVendor
@kzantow
Copy link
Contributor

kzantow commented Mar 20, 2026

Hey @dreamcreated it looks like you just need to sign-off your commit(s); thanks for fixing this!

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.

Incorrect CPE for React

2 participants