SECURITY GUIDE
PCI payment page scripts: requirements 6.4.3 and 11.6.1 for developers
Published ยท 3 min read
Two requirements in PCI DSS v4.0.1 are aimed at one attack: malicious JavaScript added to a checkout page to skim card details in the browser. Both became mandatory on 31 March 2025. They look short on paper and take real work in practice.
Note
Whether a page is in scope for these requirements depends on how you build it, for example your own form, hosted fields or a full redirect, and on which self-assessment applies. Ask your assessor or acquirer about your specific design.
What the two requirements say
Requirement 6.4.3 covers every script that loads and runs in the consumer's browser on a payment page. Three things must be true:
- Each script is authorized.
- A method assures the integrity of each script.
- An inventory of all scripts is maintained, with a written justification for why each is needed.
Requirement 11.6.1 is about detection. You need a change- and tamper-detection mechanism that alerts personnel to unauthorized changes to the payment page's HTTP headers and contents, as received by the consumer's browser. It has to be evaluated at least weekly, or at the frequency you set in a targeted risk analysis.
Put simply: 6.4.3 decides what is allowed, and 11.6.1 notices when reality drifts from that.
Step 1: build the script inventory
Open your payment page in a browser, list every script that runs, and record why it is there. Do it again after each release and after any third-party change.
| Script | Source | Why it is needed | Owner | Integrity method | Approved |
|---|---|---|---|---|---|
| checkout.js | Your own domain | Builds the order form | Web team | Hash in build, CSP nonce | 2026-10-01 |
| payments.js | Payment provider | Hosted card fields | Payments team | Provider-signed URL, CSP source list | 2026-10-01 |
| analytics.js | Third party | Funnel measurement | Marketing | Removed from payment page | n/a |
A machine-readable version is easier to check in CI:
{
"page": "https://shop.example.com/checkout",
"scripts": [
{
"src": "https://shop.example.com/static/checkout.4f2a9c.js",
"reason": "Builds the order form",
"owner": "web-team",
"integrity": "sha384-REPLACE_WITH_HASH",
"approved": "2026-10-01"
}
]
}
Watch for tag managers. A tag manager on a payment page can inject more scripts after load, and each of those needs an inventory entry. The safest choice is to keep tag managers off payment pages.
Step 2: assure integrity
Two common mechanisms are Subresource Integrity (SRI) hashes and a Content Security Policy (CSP). Use both where you can.
Generate an SRI hash for a pinned script:
openssl dgst -sha384 -binary checkout.js | openssl base64 -A
Then reference it in the page:
<script
src="https://static.example.com/checkout.4f2a9c.js"
integrity="sha384-REPLACE_WITH_HASH"
crossorigin="anonymous"></script>
SRI only works for scripts whose content does not change, so pin versions and self-host what you can. A CSP limits where scripts may come from and can report violations. This is an example to adapt:
Content-Security-Policy: default-src 'self'; script-src 'self' 'nonce-RANDOM_PER_REQUEST' https://js.payments.example; frame-src https://hosted.payments.example; connect-src 'self'; report-to csp-endpoint
Reporting-Endpoints: csp-endpoint="https://shop.example.com/csp-reports"
Use a fresh nonce on every response, and test in report-only mode first so you do not break checkout.
Step 3: detect changes
11.6.1 cares about what the browser actually receives, so detection needs to see the page the way a customer's browser does. Common approaches:
| Approach | Strength | Weakness |
|---|---|---|
| CSP violation reports | Cheap, shows unexpected sources in real browsers | Only catches what the policy blocks or reports |
| Scheduled headless-browser check | Compares scripts and headers on a schedule | Can miss attacks that target specific visitors |
| Commercial client-side monitoring | Watches real sessions and alerts | Cost, and one more third-party script to justify |
A plain server-side fetch of the page is a starting point, but it can miss scripts that are added only in the browser. Whatever you choose, alerts must reach a person, and you need a response process for when one fires.
What an assessor will look for
- The current script inventory, with a justification for each entry
- Evidence of the integrity method for each script
- Detection configuration and how often it runs
- Alert records and what was done about them
- Proof that the inventory is updated when the page changes
Checklist
- List every script on every payment page
- Write a justification for each, and remove the ones you cannot justify
- Pin versions and add SRI hashes where content is static
- Deploy a CSP, starting in report-only mode
- Keep tag managers and analytics off payment pages
- Set up change detection at least weekly, or per your risk analysis
- Send alerts to named people and test the path
- Update the inventory as part of every release