Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I need Integrity and crossorigin attributes in Locally Hosted Resources?

Tags:

Bootstrap Using integrity and crossorigin attributes on it's CDN sources like

<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>

now my question is if I want to use sources locally from my own hosted server do I still need those attributes or this will be good enough?

 <link rel="stylesheet" href="../css/bootstrap.min.css">
 <script src="../js/jquery-3.3.1.min.js"></script>
like image 908
Mona Coder Avatar asked Feb 05 '19 22:02

Mona Coder


1 Answers

I believe the short answer is No.

According to Mozilla, Subresource Integrity is a security measure for CDNs in case it becomes compromised. It uses the hash to verify it is genuinely the CDN you requested.

Since they are local resources you are using, these attributes are not needed.

like image 54
Rob B Avatar answered Oct 12 '22 03:10

Rob B