CPE-Parser icon indicating copy to clipboard operation
CPE-Parser copied to clipboard

Convert.wellFormedToFS issue

Open serkanozkanssc opened this issue 1 year ago • 0 comments

When a field in a CPE contains a trailing . character, parsing the CPE and converting it back to string generates a result different from the original cpe string. For example

String cpe = "cpe:2.3:a:bookly_project:bookly:3.4.:*:*:*:*:wordpress:*:*";
Cpe parsedCpe = CpeParser.parse(cpe);
System.out.println(parsedCpe.toCpe23FS());

Outputs

cpe:2.3:a:bookly_project:bookly:3.4\.:*:*:*:*:wordpress:*:*

Probably an edge case but there are still CPEs with this format in NVD (although probably deprecated).

serkanozkanssc avatar Aug 31 '23 18:08 serkanozkanssc