6666 <span v-for =" alias in resolveVulnAliases(vulnerability.aliases)" >
6767 <b-link
6868 style =" margin-right : 1rem "
69- :href =" `/vulnerabilities/${alias.source}/${alias.vulnId}`"
69+ :href =" `/vulnerabilities/${alias.source}/${encodeURIComponent( alias.vulnId) }`"
7070 >{{ alias.vulnId }}</b-link
7171 >
7272 </span >
@@ -446,7 +446,7 @@ export default {
446446 if (this .uuid ) {
447447 url = ` ${ this .$api .BASE_URL } /${ this .$api .URL_VULNERABILITY } /${ this .uuid } ` ;
448448 } else {
449- url = ` ${ this .$api .BASE_URL } /${ this .$api .URL_VULNERABILITY } /source/${ this .source } /vuln/${ this .vulnId } ` ;
449+ url = ` ${ this .$api .BASE_URL } /${ this .$api .URL_VULNERABILITY } /source/${ this .source } /vuln/${ encodeURIComponent ( this .vulnId ) } ` ;
450450 }
451451 this .axios .get (url).then ((response ) => {
452452 this .vulnerability = response .data ;
@@ -467,7 +467,7 @@ export default {
467467 initializeData : function () {
468468 this .uuid = this .$route .params .uuid ;
469469 this .source = this .$route .params .source ;
470- this .vulnId = this .$route .params .vulnId ;
470+ this .vulnId = decodeURIComponent ( this .$route .params .vulnId ) ;
471471 },
472472 routeTo (path ) {
473473 if (path) {
@@ -479,19 +479,31 @@ export default {
479479 ' /vulnerabilities/' +
480480 this .source +
481481 ' /' +
482- this .vulnId +
482+ encodeURIComponent ( this .vulnId ) +
483483 ' /' +
484484 path,
485485 });
486486 }
487487 } else if (
488488 this .$route .fullPath !==
489- ' /vulnerabilities/' + this .source + ' /' + this .vulnId &&
489+ ' /vulnerabilities/' +
490+ this .source +
491+ ' /' +
492+ encodeURIComponent (this .vulnId ) &&
490493 this .$route .fullPath !==
491- ' /vulnerabilities/' + this .source + ' /' + this .vulnId + ' /'
494+ ' /vulnerabilities/' +
495+ this .source +
496+ ' /' +
497+ encodeURIComponent (this .vulnId ) +
498+ ' /'
492499 ) {
493500 this .$router .push ({
494- path: ' /vulnerabilities/' + this .source + ' /' + this .vulnId + ' /' ,
501+ path:
502+ ' /vulnerabilities/' +
503+ this .source +
504+ ' /' +
505+ encodeURIComponent (this .vulnId ) +
506+ ' /' ,
495507 });
496508 }
497509 },
@@ -500,7 +512,7 @@ export default {
500512 ' /vulnerabilities\\ /' +
501513 this .source +
502514 ' \\ /' +
503- this .vulnId +
515+ encodeURIComponent ( this .vulnId ) +
504516 ' \\ /([^\\ /]*)' ,
505517 ' gi' ,
506518 );
@@ -533,7 +545,12 @@ export default {
533545 } catch (e) {
534546 this .$toastr .e (this .$t (' condition.forbidden' ));
535547 this .$router .replace ({
536- path: ' /vulnerabilities/' + this .source + ' /' + this .vulnId + ' /' ,
548+ path:
549+ ' /vulnerabilities/' +
550+ this .source +
551+ ' /' +
552+ encodeURIComponent (this .vulnId ) +
553+ ' /' ,
537554 });
538555 this .$refs .overview .active = true ;
539556 }
0 commit comments