Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPE fuzzy matching fails when strings contain valid escaped colons #4158

Open
2 tasks done
andrewjmaguire opened this issue Sep 19, 2024 · 4 comments
Open
2 tasks done
Assignees
Labels
defect Something isn't working good first issue Good for newcomers hacktoberfest Issues eligible for Hacktoberfest contributions p2 Non-critical bugs, and features that help organizations to identify and reduce risk size/S Small effort

Comments

@andrewjmaguire
Copy link

Current Behavior

I am using the docker-compose script to run a local latest Dependency
Track.

I am using CPAN Perl modules where their CPE string requires escaped
colons in some of the fields, e.g.

cpe:2.3:a:xml::libxml_project:xml::libxml:2.0134:::::perl::

But in Dependency track with all fuzzy CPE matching enabled, the
following error appears in the logs:

track-apiserver_1 |
org.apache.lucene.queryparser.classic.ParseException: Cannot parse
'product:xml::libxml~0.88 AND
cpe23:/cpe:2.3:a:.:.:.:.:.:.:.:.
:.:.
/': Encountered " ":" ": "" at line 1, column 11.

Proposed Behavior

Handle CPE strings that contain escaped characters especially escaped colons :

Perhaps a regexp is not the best thing to use for fuzzy matching
the parts of a CPE string?

Checklist

@andrewjmaguire andrewjmaguire added the enhancement New feature or request label Sep 19, 2024
@nscuro nscuro added defect Something isn't working p2 Non-critical bugs, and features that help organizations to identify and reduce risk good first issue Good for newcomers size/S Small effort and removed enhancement New feature or request labels Sep 24, 2024
@leec94 leec94 added the hacktoberfest Issues eligible for Hacktoberfest contributions label Sep 26, 2024
@dipeshsingh253
Copy link

Hi @andrewjmaguire . I would love to contribute to this. Can you please assign it to me?

@msymons
Copy link
Member

msymons commented Oct 1, 2024

@dipeshsingh253, the issue is now assigned to you. Happy Hacktoberfest!

@dipeshsingh253
Copy link

Hi @andrewjmaguire , how can I reproduce this error locally?

@andrewjmaguire
Copy link
Author

Create an SBOM, with the following cpe value:

"cpe" : "cpe:2.3:a:sys\:\:hostname_product:sys\:\:hostname:1.23:::::::*",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Something isn't working good first issue Good for newcomers hacktoberfest Issues eligible for Hacktoberfest contributions p2 Non-critical bugs, and features that help organizations to identify and reduce risk size/S Small effort
Projects
None yet
Development

No branches or pull requests

5 participants