Subresource Integrity

Description: Subresource Integrity is a security feature that allows browsers to verify that fetched resources are delivered without unexpected manipulations. This functionality is implemented through a mechanism known as Subresource Integrity (SRI), which uses cryptographic hashes to ensure that files, such as scripts or styles, have not been altered since their publication. When a browser downloads a resource, it calculates its hash and compares it to the value specified in the HTML code. If the values match, the resource is considered safe; otherwise, its execution is blocked. This feature is particularly relevant in contexts where websites rely on external resources, such as JavaScript libraries or stylesheets, which can be vulnerable to various types of attacks. Subresource Integrity not only enhances security but also fosters user trust by ensuring that the content loaded in their browser is authentic and has not been compromised. In a digital world where cyber threats are becoming increasingly sophisticated, implementing SRI has become a best practice for web developers looking to protect their applications and their users’ information.

History: Subresource Integrity was introduced in 2015 as part of the HTML5 specification. The need for this feature arose due to the increase in cyber attacks that compromised external resources, prompting developers to seek ways to ensure the integrity of the files loaded in their web applications. Since its introduction, several browsers have adopted this functionality, enhancing the overall security of the web.

Uses: Subresource Integrity is primarily used in web development to protect external resources, such as JavaScript libraries and CSS stylesheets. By implementing SRI, developers can ensure that files loaded from external servers have not been altered, reducing the risk of malicious attacks. Additionally, it is a best practice for any site that relies on third-party content.

Examples: An example of using Subresource Integrity is including a jQuery library from a CDN. By using SRI, the developer can specify the hash of the version of jQuery they are using, ensuring that a compromised or altered version is not loaded. Another case is using Bootstrap stylesheets, where SRI can be applied to ensure that the CSS has not been modified.

  • Rating:
  • 2
  • (2)

Deja tu comentario

Your email address will not be published. Required fields are marked *

PATROCINADORES

Glosarix on your device

Install
×