Skip to content

How to Detect Malicious JavaScript at Checkout: Signs and Steps

Laís Peixoto

By Laís Peixoto

Growth Marketer, Proteside

Published · Updated · 6 min read

Payment QR code with a fake layer peeling off on top, next to the Proteside shield. Payment methods: Pix, Credit card, and Debit card.

Compare what the payment page shows (Pix payee and amount, card form) with what the store issued, and review the scripts it loads and where it sends data. Malicious code usually gets in through an outdated plugin, a third-party script or a hijacked admin panel, and it can run only in the customer's browser, so a clean server scan does not rule out the problem.

To detect malicious JavaScript at checkout, compare what the payment page shows the customer with what the store issued, and check which scripts the page loads and where it sends data. In practice, start with the business signals (Pix payments with no matching order, a run of card disputes), make a test purchase on a clean device, and only then review scripts, plugins and admin panel access.

JavaScript is the code that runs in the browser of the person buying and builds the page. A malicious snippet in it can swap the Pix QR code (Pix is Brazil's instant payment system) or copy card data without the store noticing anything in its own system.

How malicious code gets into checkout

There are three common entry points. Knowing which one was used helps you decide where to look.

  • Outdated plugin, theme or extension. A flaw in one component opens the way to changing checkout files. Visa recommends keeping the cart and software up to date to keep attackers out. More in compromised plugins, themes and scripts.
  • Third-party script. Chat, marketing, audience measurement and external libraries run on the same page as the payment. The PCI SSC, the council that maintains the PCI DSS standard, noted in March 2025 that this type of attack had grown significantly, driven by reliance on external scripts. If the vendor is compromised, the altered code reaches the store without anyone touching its server. See what PCI DSS requires for third-party scripts.
  • Hijacked admin panel. With a weak or leaked password, the intruder logs in as administrator, adds a script or edits the theme. That is why Visa recommends limiting panel access to those who need it, requiring strong passwords and turning on two-factor authentication.

The inserted snippet is usually small. In the Baka case, card data theft code that Visa described in August 2020 and found on stores in several regions, a loader pulled the script from the attacker's server, using an address that could change for each store.

The signs merchants see first

  • A customer paid via Pix and the order does not show up. A single case may be a delay. Several within a few days, with receipts showing a different payee, point to a swapped QR code or Pix key on screen. How to handle support is described in the customer paid via Pix and the order did not go through.
  • A run of card disputes. Store customers who later show purchases they did not make elsewhere.
  • New or changed scripts on the payment page. A file nobody remembers adding, or a known script that changed without a scheduled update.
  • Unknown domains. In its alert about Baka, Visa listed domains used in the attack, such as jquery-cycle[.]com and quicdn[.]com, names that resemble well-known libraries and distribution services.
  • Unexplained changes in the admin panel. A new administrator or a plugin installed outside the schedule.

No single sign proves an attack. Two or more together call for immediate verification.

Verification steps, in order

  1. Record before you touch anything. Note dates, orders, receipts and disputes. Do not delete or reinstall anything yet. With strong indications, notify your payment provider and consider suspending the affected payment method.
  2. Make a test purchase on a clean device. Outside the company network, with no browser extensions and no administrator login.
  3. For Pix, compare what appears with what was issued. Scan the QR code or paste the Pix Copia e Cola (Pix's copy-and-paste payment code) into the banking app and check the payee, key and amount against what your system or payment provider generated for that order. In September 2026, Procon-SP advised consumers to check the payee's name and CNPJ (Brazil's company tax ID) and not to complete the payment if it has no relation to the store or the payment institution.
  4. For credit cards and debit cards, look at the form. Check whether an extra field, a duplicate form or an extra step asking for the data again has appeared. The signs are in fake payment form at checkout.
  5. Repeat at different times and on different devices. According to Visa, Baka erased itself when it detected the browser's developer tools open, and after sending the stolen data.
  6. Review the list of scripts on the payment page. For each one: who requested it, what it is for, where it is loaded from. Anything with no owner or justification should be investigated.
  7. See where the page sends data. Check the addresses contacted during the purchase. Visa reported that Baka disguised the transmission as the loading of an image that did not even exist, and recommends regularly checking whether the store communicates with attacker servers.
  8. Review the server, access and vendors. Recently changed checkout files, plugins, administrators, access logs and passwords. Ask each vendor whose code runs at checkout: Visa recommends knowing the code that service providers bring into the store.
  9. If confirmed, treat it as an incident. Notify the payment provider or acquirer, preserve the evidence, remove the code, change passwords and access keys, and guide the affected customers.

Why looking only at the server is not enough

A server scan is necessary, but it can come back clean while checkout is compromised. According to Visa, Baka's code was fetched from outside when the customer opened checkout and ran in the browser's memory, never stored on the store's server or on the customer's computer.

PCI DSS requirements 6.4.3 and 11.6.1 ask that the scripts on the payment page be authorized, have their integrity verified and be monitored for changes, on the server and on the page as it appears in the browser. That is the idea behind payment page integrity: checking what the buyer actually receives.

After cleanup, keep alerts on for new or changed scripts and unknown addresses. What to watch is covered in how to monitor changes at checkout.

Frequently asked questions

How do you detect malicious JavaScript on a payment page?

Compare what the page shows with what the store issued, and review the scripts loaded and the addresses the page sends data to. A visible swap (Pix, fake form) shows up in a test purchase; silent card theft does not change the screen, so a test with no difference does not rule out the problem.

Is a server scan enough to rule out the problem?

No. The code can be loaded from outside only in the customer's browser and vanish right after, as in the Baka case. You need to check the page as the buyer receives it.

What should I do first if I confirm a Pix swap?

Preserve the evidence and notify the payment provider. Tell anyone who paid the wrong payee to contact their bank right away and request a refund through MED 2.0, whose deadline the Central Bank of Brazil extended from 30 to 80 days, according to Procon-SP. Details are in MED 2.0 and what changes for the store.

To close

Detecting early depends on always comparing the expected payment with the observed one, not just hunting for strange files on the server. That comparison is what Proteside does in the payer's browser, as described in how it works.

How we create our content

Back to blog