Skip to content

Check the part and empty components of CPE identifiers - #284

Open
cvas22 wants to merge 1 commit into
openvex:mainfrom
cvas22:cpe-part-validation
Open

cvas22 wants to merge 1 commit into
openvex:mainfrom
cvas22:cpe-part-validation

Conversation

@cvas22

@cvas22 cvas22 commented Nov 27, 2026

Copy link
Copy Markdown

The validator only checked the CPE prefix and component count, so cpe:/x:... or a CPE 2.3 with empty :: components came back valid. This checks the part against a, o, h (plus the ANY/NA values NIST IR 7695 allows for each binding) and rejects empty components in CPE 2.3 formatted strings, which write unused ones as * or -. CPE 2.2 URIs can still leave components empty since that means ANY there.

Fixes #282

The validator only looked at the prefix and the number of components, so
CPEs with a made-up part like cpe:/x:... or a CPE 2.3 with empty
components (::) passed without findings. Per NIST IR 7695 the part has to
be a, o or h (or the ANY/NA logical values) and CPE 2.3 formatted strings
write unused attributes as * or -, never empty.

Fixes openvex#282

Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
@miniprow

miniprow Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: cvas22
Once this PR has been reviewed and has the lgtm label, please assign cpanato for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

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.

pkg/validate: checkCPE22 and checkCPE23 accept invalid CPE part codes and empty CPE 2.3 components

1 participant