File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/controller/cve.controller Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -218,12 +218,20 @@ function purlValidateHelper (affected) {
218218 if ( purlObj . version !== undefined ) {
219219 throw new Error ( 'The PURL version component is currently not supported by the CVE schema: ' + purlStr )
220220 }
221+
222+ // Check for versions within qualifiers
221223 if ( purlObj . qualifiers !== undefined ) {
222224 if ( Object . keys ( purlObj . qualifiers ) . includes ( 'vers' ) ) {
223225 throw new Error ( 'PURL versions are currently not supported by the CVE schema: ' + purlStr )
224226 }
225227 }
226228
229+ // PackageURL does not properly prevent encoded ':', so check for that here
230+ const encColon = / % 3 a / i
231+ if ( encColon . test ( purlStr ) ) {
232+ throw new Error ( 'Percent-encoded colons are not allowed in a PURL: ' + purlStr )
233+ }
234+
227235 // PackageURL does not properly account for certain Subpath situations
228236 // so adding additional validation to account for them
229237 // Handles PURLs that include a # but no subpath
You can’t perform that action at this time.
0 commit comments