Join our Newsletter — 33% off our NHI Course
Home› Glossary› Cyber Security› JavaScript Skimming
Cyber Security

JavaScript Skimming

← Back to Glossary
By NHI Mgmt Group Updated November 25, 2026 Domain: Cyber Security

JavaScript skimming is a payment fraud technique where malicious JavaScript is injected into a website to capture card or form data as it is entered. The script runs in the browser, often on checkout pages, and sends stolen data to an attacker before it reaches legitimate payment processing or validation controls.

What JavaScript skimming does in the browser

JavaScript skimming is a client-side payment attack: malicious code is added to a webpage so it can intercept data while a visitor is typing it. Because the theft happens in the browser, the attacker can capture card numbers, names, addresses, and other form fields before downstream payment or validation logic has a chance to block the submission.

This makes the attack especially effective against checkout flows that assume the browser is trustworthy once the page loads. A skimmer can blend into legitimate page scripts, watch only selected inputs, and exfiltrate data quietly enough that the shopper sees a normal checkout experience.

How the attack is inserted and executed

Skimmers are usually delivered by compromising a website, a tag manager, a third-party script, or a JavaScript package that the site already trusts. Once present, the code runs with the same browser privileges as other page scripts, which means it can read DOM fields, hook form events, and collect data as soon as it is entered.

The attack often relies on ordinary front-end mechanics rather than exotic malware. That is why review of the site’s script inventory, third-party dependencies, and checkout page change history is central to understanding whether a page could have been altered to include skimming logic.

What makes it dangerous for payment pages

The danger is not just data theft, but theft before the data reaches legitimate processing controls. That can let an attacker steal payment details, bypass back-end logging expectations, and harvest information even if the server-side application itself remains uncompromised.

Because the code runs in a user’s browser, defenders may not see a traditional server compromise. The compromise can live entirely in the delivery chain, the page template, or a trusted script source, which makes the attack hard to spot from payment-system monitoring alone.

For teams that want a broader security-control lens on checkout protection, NIST SP 800-53 Rev 5 Security and Privacy Controls is a useful reference for controls around integrity, access, logging, and configuration discipline.

How organisations reduce exposure and detect compromise

Exposure checks should start with the pages that collect payment or sensitive form data, then extend to every script that can execute on those pages. Organisations need an inventory of approved scripts, a review process for third-party changes, and a way to compare the live page against known-good content.

Detection should focus on unexpected script changes, new outbound destinations, altered form handlers, and unusual client-side code paths on checkout pages. After a suspected compromise, teams should review whether the malicious code captured data, how long it was present, and whether credentials, sessions, or payment-related secrets need rotation or invalidation.

For defenders mapping this to known attack behaviour, the MITRE ATT&CK Enterprise Matrix helps frame credential theft, web compromise, and post-compromise activity as connected adversary behaviours rather than isolated alerts.

Because script injection and dependency compromise are common delivery paths, SLSA is also relevant when organisations need stronger provenance and integrity checks for the software and dependencies that ultimately execute in the browser.

Risk and Threat Considerations

JavaScript skimming creates a high-value theft path because the attacker can steal payment data at the point of entry, before normal transaction controls, fraud checks, or server-side validation can intervene. The same technique can scale quickly if the compromised script is served to every visitor on a busy checkout page.

Failure mechanism: An attacker injects or replaces browser-executed JavaScript through a compromised site asset, third-party dependency, or checkout-page change, then hooks form fields or submission events to copy data out to an external destination.

Impact: Cardholder data and other sensitive form values can be harvested invisibly, creating fraud exposure, incident-response costs, customer notification duties, and possible downstream misuse of the stolen data.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

NIST SP 800-53 Rev 5, CIS Controls v8 and OWASP ASVS set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST SP 800-53 Rev 5SI-7 — Software, Firmware, and Information IntegrityProtects page and script integrity against unauthorized modification
AU-6 — Audit Record Review, Analysis, and ReportingSupports review of script changes and suspicious checkout activity
CM-3 — Configuration Change ControlApplies to controlled changes on checkout pages and trusted scripts
Recommendation — Validate checkout-page script integrity and investigate unauthorized client-side changes. Review logs and change records for unexpected checkout-page script updates and exfiltration signals. Require approved change control for scripts that execute on payment pages.
CIS Controls v8CIS-16 — Application Software SecurityAddresses secure web application change and dependency management
Recommendation — Harden and verify web application scripts that handle payment data.
OWASP ASVSV13 — ConfigurationCovers secure configuration of web applications and delivered client code
Recommendation — Lock down and verify browser-delivered configuration and script sources on checkout pages.

Practitioner Guidance

Why practitioners should care: Treat checkout-page script control as part of payment security, not just front-end hygiene. If the browser can be modified, the payment workflow can be subverted before the server ever sees the data.

What to watch for: Focus review on script drift, unfamiliar third-party code, unexpected outbound domains, and form handlers that changed without a matching release record. In practice, the fastest way to catch skimming is to compare what the page should load with what it actually loads.

Practitioner takeaway: The strongest defence is control over what the browser is allowed to execute, paired with fast review of any change that touches checkout pages or the scripts they depend on.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org