Subresource Integrity (SRI) is not implemented, and external scripts are not loaded securely

Published on 19 Jun 2018
1 min read
Vulnerability
SRI

Subresource Integrity (SRI) provides a method to protect website delivery. It provides a mechanism to check the integrity of the resource hosted by third parties interface plug-ins. The plug-ins might include Content Delivery Networks (CDNs). This method verifies if the fetched resource has been delivered to the user without unexpected manipulation. This method ensures these assets have not been compromised for hostile purposes. SubResource Integrity cannot mitigate all risks in the application. A 3rd party javascript could access information from the end-users. Subresource integrity was introduced by scan and verify fetched files. An integrity value starts with at least one string. Each string contains a prefix that indicates hash algorithm. An integrity value may have multiple hashes, separated by whitespaces.

Example

The below code is an example of integrity string with base64-encoded sha384 hash.

        sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wq4JwY8wC

    

Impact

An attacker can gain access to Content Delivery Networks and cause huge damage to the application. If the attacker is one of the persons who had developed one of the CDN used by the application. He can gain access to your system by tweaking the content from CDN.

Mitigation / Precaution

Beagle recommends the following:-

  • Implement Sub resource integrity properly.
  • Load external URLs via HTTPS
Manindar Mohan
Written by
Cyber Security Lead Engineer

Manieendar is a dedicated Security Engineer with a wealth of experience in the cybersecurity landscape. He plays a pivotal role at Beagle Security, where he employs his extensive knowledge to safeguard systems against cyber threats. Manieendar's passion for cybersecurity extends beyond his professional role; he actively contributes to the online security community through insightful articles and speaking engagements.

Experience the Beagle Security platform
Unlock one full penetration test and all Advanced plan features free for 14 days
4.8 on G2 • ISO 27001 certified
See How Beagle Security Works
No credit card • No setup required
Launch interactive demo