Automattic / Automattic/jetpack

Add SRI to devicepx-jetpack.js

Open
#10,760 2 comments 0 reactions 0 assignees View on GitHub
[Feature] Theme Tools [Pri] Low Enhancement General
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

#### Is your feature request related to a problem? Please describe.

The file `devicepx-jetpack.js` should be loaded with SubResource Integrity.

#### Describe the solution you'd like

#### Describe alternatives you've considered
[SRI is well supported in major browsers](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) and has no negative impact on legacy browsers.

Adding SRI means that if the CDN is compromised, or the code is maliciously altered, browsers will not execute it.

#### Additional context

As per #10027, the CDN supports CORS.

Contributor guide

Open the contributing guide

Research direction

Locate where devicepx-jetpack.js is loaded and start by checking that generated script tag against the issue's SRI and crossorigin example. Done means the file is loaded with the requested integrity protection and cross-origin setting, with the existing loading behavior preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
security
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.