Hosted payment fields: the cheapest way to remove skimming risk

Diagram: a checkout page with card inputs inside a provider iframe that a skimmer on the page cannot read.

Most of the defences against card skimming are about watching a payment page carefully: inventory the scripts, pin them, monitor for change, block unexpected connections. All of that is worth doing. But there is one change that does something better than watch the risk, it removes most of it, and for a small merchant it usually costs nothing but an afternoon. It is moving the card fields out of your own page and into hosted payment fields.

The idea

A skimmer works because the card number, expiry and security code are typed into form fields that live in your page, where any script on that page can read them. Hosted fields change where those inputs live. Instead of a plain <input> in your document, the card fields are small frames served directly by your payment provider and embedded into your checkout. To the customer they look like part of your form. Technically they belong to the provider’s page, not yours.

The browser enforces a strict boundary between those frames and the page around them. A script running in your page cannot read what is typed into a frame from another origin. So a skimmer injected into your checkout, by whatever route, finds the card fields simply unreadable. The card data goes straight from the frame to the provider and never passes through code you wrote or code you accidentally loaded.

Providers offer this under various names, hosted fields, payment elements, embedded or drop-in components. The mechanism is the same in each: the sensitive inputs are isolated in a frame the provider controls.

Why it beats monitoring

Monitoring tells you a skimmer arrived, ideally quickly. Hosted fields mean that when one arrives, it gets nothing. That is a categorical difference. You are no longer relying on catching the attack in time; you have arranged things so the attack has nothing to steal from the page it can reach.

It also shrinks your compliance burden. Under the Payment Card Industry rules, the more of the card data that touches your systems, the more of the standard applies to you. When the card fields never enter your page, far fewer requirements land on you, and the simplest self-assessment questionnaire may become available where a much heavier one applied before. That is a real saving in time and audit cost, on top of the security.

What it does not cover

Hosted fields protect the card data. They do not protect everything else on the page. Name, address, email and phone are still typed into ordinary inputs in your document, and a skimmer can still harvest those. That is worth less to a criminal than a card number, but it is still a data breach and still your responsibility, so the other defences do not go away.

There is also a subtler point. The frame is only as trustworthy as the code that loads it. If an attacker can alter your page, they cannot read the frame, but they could in principle replace the whole payment section with a fake of their own. That is a harder attack and a more visible one, and a Content Security Policy that constrains what your page can load and where it can send data makes it harder still. Hosted fields plus a tight policy is a strong combination; hosted fields are the bigger single step.

Making the change

If you are on a mainstream e-commerce platform, hosted fields are usually a setting or an official plugin from your provider rather than a build. If you have a custom checkout, it is a development task, but a well-documented one, and every major provider has a guide. The test that it is working is simple: load the checkout, open the browser’s developer tools, and confirm the card inputs sit inside a frame served from the provider’s domain, not from yours.

The short version

Hosted payment fields put the card inputs in a frame served by your payment provider, where scripts on your page cannot read them. A skimmer that reaches your checkout finds nothing to take. It reduces your compliance burden as well, and for most small merchants it is a configuration change rather than a project. It is the single biggest reduction in skimming exposure available, and it is usually free.