Repository navigation
Fix embedded wildcard validation in cpeName searches - #157
Merged
Merged
Conversation
jdaigneau5
approved these changes
Sep 23, 2026
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.
Summary
Fixes
POST /searchaccepting embedded wildcards in requiredcpeNamecomponents even though this filter expects a concrete asset name.Review scope: 7 files, 126 additions and 43 deletions. Of the 169 changed lines, 18 are runtime logic, 127 are regression tests, and 24 are documentation or generated OpenAPI. The only runtime change is in
utils/cpe.js.Why These Changes Were Needed
Production accepted inputs such as
2.6.*and10.*as concretecpeNameversions. Range comparison discarded their wildcard characters, so these searches behaved like versions2.6and10rather than version-family searches. This produced successful responses with unexpectedly narrow or broad result sets.*and?anywhere in the requiredcpeNamecomponents, using the existing HTTP 400INVALID_CPE_NAMEresponse. Recognize escaped literal characters without accepting a wildcard after an escaped backslash.*, allowing unsupported patterns to reach semantic version comparison.-, escaped literals, and existing punctuation handling remain accepted.2.6inclusive to2.7exclusive example.Compatibility and Scope
cpeNamecomponents will now receive HTTP 400 instead of misleading successful results.virtualMatchStringwithout a version component and provide explicit version boundaries. For all versions, usevirtualMatchStringwith an omitted version or a whole-component*.isVulnerableretains its current name and behavior.-remains the supported CPE NA value, with its existing range-matching policy.virtualMatchStringbehavior, and/webSearchare unchanged.