-
Notifications
You must be signed in to change notification settings - Fork 531
fix(uC/lib): handling of product names with special characters #4959
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
base: main
Are you sure you want to change the base?
fix(uC/lib): handling of product names with special characters #4959
Conversation
I'm going to approve the tests to run, but I'm not sure if this will actually solve our problem: we may need less normalization because I think the character is actually in the CPE definition so taking it out may break things. |
In addition to @terriko remark,
PR should be updated to take this change into account. |
yes! thanks for information, and sorry for the delay (due to end-sem exams). I'll soon update the PR to fix this issue... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the tests most definitely did not pass, and this may need some other updates, so I'm marking it as needing changes.
Hey!
However, while testing with another file, I ran into an issue — it does show the triage data for uc/lib, but it marked it as "unexplored" (this worked fine in the other file). |
Hi @terriko, I've improved the normalization on I know this still might need improvements, but I wanted to get your thoughts on the approach first before I go ahead with test fixes and cleanup. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to approve the tests to run, but some general feedback:
- We should see if we can handle escaped characters directly through the python CSV libary rather than having to do quite so many replace functions. I feel like it's got to be possible but I haven't really dug through the docs yet: https://docs.python.org/3/library/csv.html
- I see you've got a normalize_product_name in parse_csv but aren't using the same "use a utility function" elsewhere. is there a reason for that? We probably want to just stick this into cve_bin_tool.util and re-use as much as possible.
thanks for the feedback! |
Description-
Fixes #4417
In this issue cve-bin tool was deleting the triage data for micrium uC/Lib, it showed unexplored in the html & csv reports (which was not expected)
This was occurring because of the way URNs were parsed in cve-bin tool for the product names (specially for special characters like "/")
for ex -
urn:cbt:1/micrium#uc/lib:1.38.01
- the slash in "uc/lib" was causing the issue.Solution -
HTML ID Normalization
- Added a normalize_id() function which safely converts product names with special characters into valid HTML IDsSteps to reproduce the issue From comments
cve-bin-tool -i test_SBOM.csv --vex-file test_cve-bin-tool_triageFile.json -f csv,html --vex-output triage0919a.json
Python version - Python 3.11.0rc1
OS - Windows 10 (WSL)
Output after the fix - Output csv file
Html reports screenshots -