Angular generating index.html file with relative css file imports

Discussão em 'Angular' iniciado por Saurabh Tiwari, Fevereiro 4, 2025.

  1. I am using Angular 16 and the production dist generated by Angular imports the styles.css in a relative fashion as below:

    This has been flagged as a vulnerability (PRSSI) by our security team as per the Qualys scan. Refer the vulnerability here - https://portswigger.net/kb/issues/00200328_path-relative-style-sheet-import

    The expected import should be:

    with a leading slash at the start, which makes the import static from the root folder.

    Is there any way to tell Angular to import it in the correct way.

    Since, the build is generated via a CICD pipeline, the only workaround that I have currently is to modify the generated index.html file manually. Is there any better way to do this ?

    Continue reading...

Compartilhe esta Página