Skip to content
MonSpark home

Only approved code runs on your checkout

MonSpark finds every script on your payment pages, keeps each version for your auditor, and stops the scripts, field reads and requests that you did not approve. PCI DSS v4.0 requirements 6.4.3 and 11.6.1 apply since 31 March 2025.

The risk

A few lines of JavaScript can copy every card number

  1. 1

    A script changes

    An attacker changes one script that your page already loads: a tag manager, a chat widget, a library from a CDN.

  2. 2

    It reads the card field

    The changed script listens to the card number field while the customer types.

  3. 3

    The data leaves

    The script sends the number to a host that the attacker controls. Your server sees a normal payment.

A trusted source is not enough. A domain that thousands of sites trust can start to serve changed code. MonSpark compares the content of each script, not only its URL.

Compare

Why a CSP header alone is not enough

CapabilityCSP header onlyManual reviewMonSpark
Inventory of every script, with a justification–A spreadsheet✓
Detects a change in script contentInline hashes onlyWhen someone checks✓
Detects header changes–When someone checks✓
Sees what real visitors receiveViolation reports–✓
Blocks unapproved scripts in the browser✓–✓
Stops other scripts from reading card fields––✓
PDF report for your assessor–By hand✓

PCI DSS v4.0

Each part of 6.4.3 and 11.6.1, and the MonSpark feature for it

RequirementWhat it asksMonSpark
6.4.3AuthorizationA method confirms that each payment page script is authorized.Each script version needs an approval. The approval records who approved it and when. A new version of an approved script is unapproved until somebody approves it.
6.4.3IntegrityA method assures the integrity of each script.A SHA-256 hash for each version, compared on every scan. The page agent can pin a script to its approved hash with Subresource Integrity, so the browser refuses changed content.
6.4.3InventoryAn inventory of all scripts, with a written business or technical justification for each.The inventory lists external and inline scripts in every frame, with their versions, first and last seen times and justifications. AI drafts the justification from the code.
11.6.1Change and tamper detectionA mechanism alerts personnel to unauthorized changes to security-impacting HTTP headers and script contents, as the consumer browser receives them. It runs at least once a week, or as often as your risk analysis sets.Scans on the schedule that you set, and the page agent in real visitors' browsers. A new, changed or removed script, or a changed header, opens an incident. Escalation policies send it by email, Slack, Microsoft Teams, Discord, Telegram, webhook, SMS or phone call.

Setup

From the first scan to enforcement

  1. 01

    Add your checkout

    Enter the page URL and the steps to the payment form: add to cart, log in, fill the address. A test run shows each script that the page loads. The scenario stops before the payment.

  2. 02

    Approve the scripts

    Approve the scripts from the test run, with a justification for each. This is your first inventory and the baseline for change detection.

  3. 03

    Add the page agent

    Put one script tag first in the head of the payment page. In monitor mode it reports what real visitors load and blocks nothing. Each scan checks that the tag is there and first.

  4. 04

    Turn on enforcement

    A new policy starts in dry run. MonSpark shows what it would have blocked in the last 24 hours. When the list is right, turn dry run off.

For developers

Approve scripts where you ship them

The public API gives your pipeline three calls: approve or revoke a script version, read the script inventory, and read your CSP reports.

  • POST /api/v3/pcidss/verify-script
  • GET /api/v3/pcidss/:monitorId/script-inventory
  • GET /api/v3/csp/reports
# Approve a script version from your pipeline
curl -X POST https://<your MonSpark host>/api/v3/pcidss/verify-script \
  -H "Authorization: Bearer $MONSPARK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "monitorId": "<monitor id>",
    "scriptId": "<script id>",
    "verified": true,
    "name": "Checkout app",
    "justification": "Our own checkout bundle, release 4.12"
  }'

Inside the page agent

See what the agent sees in each visitor's browser

The page agent reports every destination, every card field read and every cookie write. In Enforce mode it blocks what the policy does not allow.

Destinations: the hosts that scripts sent requests to. A request to collect.cdn-x.top from an unknown script was blocked 3 times.

Screens from the MonSpark PCI app, with example data.

Page agent

Built to stay out of your customer's way

0 values

field values sent

No card data

The agent never sends field values, keystrokes, cookie values, storage values or request bodies. It removes query strings from URLs. The server uses the IP address for the country, then drops it.

≤ 12 KB

with gzip, ≤ 3 ms start

Small and fast

12 KB or less with gzip. Each release must start in 3 ms or less for a returning visitor, measured on Chrome at 4x CPU slowdown. No network call blocks the page.

Fails open

the page never breaks

Fails open

If a check fails, the browser function runs as usual, so the agent never breaks the page. The CSP header from your approved inventory is the layer that fails closed.

≤ 5 min

for a policy change

Changes in 5 minutes

The hosted tag always serves the latest published policy. A change of mode reaches browsers in 5 minutes or less. That is also your off switch.

SRI

pinned or self-hosted

Pinned or self-hosted

If your policy needs Subresource Integrity on every script, use a pinned version with its integrity value, or host the file on your own CDN.

Compatible

with code that wraps browser functions

Works with your code

The agent works next to error trackers and other code that wraps browser functions.

Questions

Do I need the page agent?

No. Scans alone give you the inventory, the approvals, change detection and the reports. The agent adds the view of real visitors and the blocking in the browser.

Our card fields are in the payment provider's iframe. Is that covered?

An iframe from another origin is outside the reach of your page's agent. That iframe is in the scope of your payment provider. The scan still records the scripts in every frame, including cross-origin frames.

Which browsers do the scans use?

Chrome by default, or Firefox. Each scan records a screenshot, a HAR file, a screen recording and the console log, if you turn them on.

Can MonSpark write our Content Security Policy?

Yes. MonSpark builds a CSP header from the scripts and destinations that you approved. A test scan puts the header on the page and lists the violations before you deploy it. MonSpark also collects your CSP and SRI violation reports.

Is there an API?

Yes. The public API gives you the script inventory of a monitor and your CSP reports. Your deploy pipeline can also approve or revoke a script through it.

In which languages is the app?

English and Turkish.

Book a demo

See MonSpark on your own payment page

Our team shows you the scripts on your checkout today, and what 6.4.3 and 11.6.1 need from you.

  • Free proof of concept
  • Live demo on your payment pages
  • Compliance readiness assessment

We use your details only to arrange the demo. Read our Privacy Policy.