]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
cve_check: Escape special characters in CPE 2.3 strings
authorStefano Tondo <stefano.tondo.ext@siemens.com>
Thu, 12 Mar 2026 15:38:44 +0000 (16:38 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 18 Mar 2026 17:07:26 +0000 (17:07 +0000)
commit9dd9c0038907340ba08ff4c8ee06a8748c1ac00a
tree05586e6d078100a69279fe4e914d7e135c473268
parent952990d3bdc8a7fec9b89c2b22a725353a618edd
cve_check: Escape special characters in CPE 2.3 strings

CPE 2.3 formatted string binding (cpe:2.3:...) requires
backslash escaping for special meta-characters per NISTIR 7695.
Characters like '++' and ':' in product names must be escaped.

The CPE 2.3 specification defines two bindings:
- URI binding (cpe:/...) uses percent-encoding
- Formatted string (cpe:2.3:...) uses backslash escaping

Escape the required meta-characters with backslash:
- Backslash (\\) -> \\
- Question mark (?) -> \?
- Asterisk (*) -> \*
- Colon (:) -> \:
- Plus (+) -> \+

All other characters are kept as-is without encoding.

Example CPE identifiers:
- cpe:2.3:*:*:crow:1.0\+x:*:*:*:*:*:*:*
- cpe:2.3:*:*:sdbus-c\+\+:2.2.1:*:*:*:*:*:*:*

Signed-off-by: Stefano Tondo <stefano.tondo.ext@siemens.com>
Reviewed-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
meta/lib/oe/cve_check.py