Skip to Content
Onshore is in early access. Don’t load real customer data until the items in Known limits are closed.

Page protection

A checkout or KYC page can be emptied by one compromised third-party script. Page protection keeps a list of what runs on your sensitive pages, and tells you when that list, or a script’s contents, changes. It supports the script inventory and change detection that card-payment rules ask about.

Page protection, with Protect a page and the list of protected pages

This hasn’t been assessed against any card-industry standard, and using it doesn’t make a page compliant.

Protect a page

Add the page

Select Protect a page and enter its address.

Report only

Send the header shown under 1. Report only on that page. Browsers report every script, and nothing is blocked.

Add the watcher (optional)

Add the snippet under 2. Watcher to catch scripts added after the page loads.

Decide on each script

Browse the page. Scripts appear as need a decision. Approve or reject each one with a reason. Approving records the file’s fingerprint (SHA-256).

Enforce

When the list is right, use the header under 3. Enforce. It blocks anything not approved, so try it on a staging page first. Your own inline code needs a nonce.

Select Scan now to fetch the page from the server immediately. Scans also run every 15 minutes.

Three ways scripts are seen

SignalSeesWeakness
Browser report (the header)Everything the browser loads, including inline codeYou must set a header; some extensions block reports
Watcher scriptScripts added while the page runsA hostile script on the same page could interfere
Server scanScript tags in the page’s HTML, and each approved file’s fingerprintOnly what an unauthenticated request gets; misses pages behind a login

Alerts

AlertWhen
New scriptA script not seen before on this page
Script changedAn approved file’s contents changed. It loses its approval until someone looks again
Rejected script seenA rejected script ran again, at most hourly
Report floodMore than 50 new scripts in an hour, or 500 on a page

Each also sends a webhook event.

What is stored

Script addresses only. Query strings and fragments are dropped, and a path segment holding ten or more digits or an @ becomes [removed]. The watcher reads script addresses and nothing else: no form fields, cookies or page text.

Last updated on