Found it. Now, in order.
Malicious JavaScript Injected on Your Website: The First Hours After You Find a Tampered Script
Checkout still works. Orders still arrive. Nobody has complained. Then someone opens the browser's developer tools on the payment page and sees a familiar script calling an address nobody in the company has ever heard of. The calm was the attack working as designed.
November 19, 2026 · 10 min read
- PassTampered script saved with timestamps
- PassHAR recording of the checkout exported
- PassMalicious tag paused in the tag managernew version
- FailTag manager users with publish rights6 people
- WarnPayment API keys rotatedpending
- PassProcessor, attorney and insurer told
- FailBrowser policy limits where data can gonone set
The short answer
If you find malicious JavaScript on your website, copy the evidence before removing it: the tampered file, a recording of what the page loaded, and the account or file it came from. Then take it off the page, find how it got in, rotate every login and key it could reach, and clean. Tell your processor, attorney and insurer if card or customer data may be exposed. Not legal advice.
On this page
- A familiar script, calling an address nobody owns
- Copy the tampered script before anyone deletes it
- Pull the code off the page, not off the record
- Vendor, tag manager, plugin, server or settings field: finding the way in
- Rotate everything the script, or its author, could touch
- Your processor, your attorney, your insurer: their calls, not ours
- Afterward: the controls that make a second attempt harder
- The cost of the first day, and the fixed-price WordPress route
A familiar script, calling an address nobody owns
The discovery is rarely dramatic. A developer checks the network panel, the part of the browser's developer tools that lists everything a page loads, and spots a request to an odd domain. The script responsible is one the business chose on purpose: the chat widget, the analytics tag, the testing tool. Its contents are not. There is a long line of scrambled text and a call to atob, a browser function that turns encoded text back into readable code. Somebody wanted this to be hard to read.
This page covers the hours after that moment. It is about tampered JavaScript, code that was changed or added so that a visitor's browser runs it on your page, rather than a defaced or redirecting server, though the two often travel together. If the whole site is hijacked, our hacked website emergency page covers taking a server offline. The order below is ours: preserve, contain, find the way in, rotate, clean, tell the right people, then lock down.
Tampered scripts arrive from more directions than owners expect. On its status page, in a post dated November 17, 2026 at 01:02 UTC, Optimizely said an unauthorized party "exploited a vulnerability in Experimentation" and used it to add malicious JavaScript to some customer projects. Those customers' own servers were never touched. Our account of the Optimizely hack explains how the code traveled.
Copy the tampered script before anyone deletes it
The instinct is to rip the code out. Give it ten minutes first. Once a vendor or a well-meaning teammate cleans the script, the only copy of what it did may be gone, and the people who will need it later, your processor, your insurer, your attorney and any forensic firm they appoint, will ask for exactly that.
- 1
Save the script as it was served
Open the script's address in a browser and save the file, or save it from the developer tools. Save the full page too. Put the date and time in every file name.
- 2
Record what the page loaded
Most browsers can export a HAR file from the network panel: a recording of every request the page made, including where it sent data. Export one from the checkout and one from the home page. Store them privately, since they can contain session cookies.
- 3
Screenshot with the clock showing
Capture the network panel with the strange request visible and the system clock in frame. It sounds fussy. It settles arguments later about when the code was live.
- 4
Export the place the code lived
If the script came from a tag manager, export the container and its version history. If it came from a vendor project, copy its custom code settings. If it came from your own files, ask the host for a snapshot.
- 5
List everyone who could change it
Vendor users, tag manager publishers, content system administrators, hosting and repository logins. Write the list down. Do not delete anyone yet; their accounts are evidence too.
- 6
Start one shared timeline
When it was found, by whom, what each person did and at what time. Every later step goes on it.
Pull the code off the page, not off the record
Containment means visitors stop receiving the code. It does not mean the code stops existing. The fastest safe move depends on where it lives, and in every case the old version should survive somewhere your team can read but not run.
- A tag in a tag manager: pause or remove the tag and publish a new version. The old version stays in the history, which is your evidence.
- A vendor script you load: remove the line that loads it, or switch the vendor off in your settings, until the vendor confirms its file is clean and you have rotated your access to its account.
- A plugin or theme on your site: deactivate it, or take the site offline from outside the server as the hacked website page describes, if you cannot tell what else it changed.
- Your own code: deploy the last version you know was clean and keep the tampered build for comparison.
- Card entry itself: if shoppers type cards into your own form, consider switching to your processor's hosted payment page until the work is done.
That last item has evidence behind it. Report URI, a company that sells script monitoring, reported on November 16, 2026 that the Optimizely payload skimmed card details from sites' own forms, while cards typed into a payment company's hosted fields were out of its reach. If removing a tag breaks checkout, and sometimes it does, the checkout emergency page covers getting payments moving again without ever collecting card numbers by hand.
Vendor, tag manager, plugin, server or settings field: finding the way in
Cleaning before you know the way in is how the same code comes back next week. The table lists the usual hiding places for injected JavaScript and what we examine in each. The evidence you saved above is what tells you which row you are in.
| Where the code lived | Likely way in | What we check |
|---|---|---|
| A vendor's hosted script, such as testing, chat or reviews | The vendor itself was compromised, or someone got into your account with that vendor | The vendor's notices, your account's users and tokens, and recent changes to your settings |
| A tag manager container | A login with publish rights was phished, shared, or left with a former agency | Every user and permission level, the version history, and who published what and when |
| A WordPress plugin or theme | A known vulnerability in an outdated component | Installed versions against published advisories, modified files and unknown admin users |
| Your own server or deploy pipeline | Stolen hosting, SFTP or code repository credentials | Access logs, recent deploys and any keys stored in code |
| A content system setting that prints on every page | A compromised administrator account pasting code into a header or footer field | Recently edited settings, widgets and custom code fields |
Tag managers deserve particular suspicion because their permissions are broad. Google's Tag Manager help page on users and permissions, read November 18, 2026, describes a Publish level with "full rights to create versions, workspaces, make edits, and publish." Anyone holding it can change what every page runs without going near your server. Our tag manager cleanup trims that list for good.

Rotate everything the script, or its author, could touch
Report URI's advice to Optimizely customers, published November 16 and updated November 17, 2026, works as a template for any tampered script: review and rotate users, API tokens and integrations, rotate secrets kept in cookies that scripts can read, and treat cards entered during the exposure as possibly exposed. A cookie is a small file a site stores in the visitor's browser, often to keep them signed in. Some are locked away from scripts; the readable ones can be copied, and rotating makes the copies worthless.
- Vendor accounts and API tokens for the service that carried the code, plus any integrations connected to it.
- Tag manager users: remove anyone without a current reason, and cut publish rights to the fewest people who need them.
- Content system administrators, hosting, SFTP, database and repository credentials, changed from a device you trust.
- Payment API keys, if the site's code or settings held them anywhere a script or intruder could reach.
- Session secrets and script-readable cookies, so stolen sessions stop working, even if customers must sign in again.
- Two-factor sign-in, switched on for every account that offers it.
Cleaning a tampered script without changing the login that wrote it is mopping under a running tap.
Your processor, your attorney, your insurer: their calls, not ours
If the script touched a card form, a login form or any field holding personal details, this is no longer only a website repair. Call your payment processor, your attorney and your insurer before cleanup is finished, and let counsel decide what customers hear and when. Breach notice rules vary by state; our data breach first hours page explains why the order of those calls matters.
Our part is the technical record they will ask for: when the code first appeared, as far as the evidence shows, what it did, which pages carried it, when it came off and what changed afterward. We do not tell you whether you must notify anyone. We are not a PCI Qualified Security Assessor. And we cannot promise to find every trace an intruder left; we will say plainly what the evidence shows and where it runs out.
Afterward: the controls that make a second attempt harder
Once the code is gone and the doors have new locks, the goal is that the next tampered script is refused, or at least noticed quickly. None of these makes a site unhackable. Each removes something an attacker relied on this time.
A fresh inventory
A script audit lists what loads, who owns it and what gets cut. Every removed script is one less vendor whose access can be borrowed.
A browser policy
A content security policy refuses scripts you did not approve and limits where your pages may send data.
Someone watching
Script monitoring from real browsers, so a changed file is noticed by us rather than by your customers' banks.
Card rule records
For stores, the payment page script records that PCI DSS asks for, built from what this incident taught you.
Fewer borrowed parts
Swapping risky plugins for custom code shrinks the list of strangers who can change your pages.
The cost of the first day, and the fixed-price WordPress route
We respond the same business day; our hours are on the contact page. Tampered script response is from $575, depending on complexity, with a written estimate before work starts. Where the code lived, how many accounts need rotating and whether a server is also compromised move the number. Our malware removal and website security service covers longer cleanups.
For a WordPress site where the code sits in your own files or database, the Fix it now malware cleanup is $349, paid online on the WordPress malware removal page or through Fix it now. We start within one business day of payment, with a full refund if we can't fix it. Code carried by an outside vendor or a tag manager is a quoted job instead.
You may not need us at all. If a vendor's own script was tampered with, the vendor has cleaned it and your account was never involved, the work is the rotation list and the processor call above, which your own team may handle. Not sure the site is even reachable? Is my site down answers in seconds, and the emergency repair hub covers other outages. DataCram is a San Antonio web studio, building since 1999. See our work, the website security overview, or call (210) 346-0848.
Questions owners ask about website security
Not before you copy it. Save the tampered file, a HAR recording of what the page loaded and screenshots with the time showing, and export the tag manager or vendor settings it came from. Then take it off the page. Once the code is gone, it is hard to prove what it did, and your processor, insurer and attorney may need exactly that.
Open the checkout in a browser, open the developer tools' network panel and look for requests to addresses you do not recognize, especially after typing in a form. Scripts full of scrambled text are another warning sign. A processor alert or customers reporting fraud after buying from you are reasons to look now. A script audit checks every page properly.
It depends on what data was exposed, where your customers live and what your processor agreement says, and we cannot answer it for you. Breach notice rules vary by state. Talk to your attorney, insurer and payment processor before you notify anyone or finish cleaning. This is not legal advice.
Usually not on its own. Whoever added it had a way in: a vendor account, a tag manager login, a vulnerable plugin or stolen hosting credentials. Until that door is closed and every login and key it could reach is rotated, the same code can return. Find the way in before you call it clean.
It is for WordPress sites where the injected code sits in your own files or database. It costs $349, paid online; we start within one business day of payment and refund in full if we can't fix it. Code carried by an outside vendor or a tag manager is handled as a quoted job from $575.
Hosted fields keep the card number away from your page's own code, which helps. Report URI found the November 2026 Optimizely payload could not reach cards typed into a payment company's hosted fields. Every incident differs, though, and a script may still have read logins, addresses or other details. Ask your processor to review what it saw during the exposure window.
Keep reading
- Contain first, clean secondHacked Website Emergency: Contain It, Keep the Evidence, Then CleanYour website was hacked. How to contain it, keep the evidence, lock every login, follow Google's quarantine and review steps, and know when to call counsel.
- Not legal advice. Read anyway.Data Breach: What to Do in the First Hours, Before Anyone Wipes the EvidenceThe first hours after a data breach: contain it without destroying evidence, call your attorney, insurer and police, and know the Texas notice deadlines.
- Start with the listThird-Party Script Audit: Every Script on Your Website, Who Owns It, and Whether It StaysWhat scripts are on your website? We load pages in real browsers, list every script with its owner and reach, and mark each one cut, keep or lock down.
- The browser's guest listContent Security Policy Setup: Listen First, Enforce Second, and Stop Trusting Whole VendorsCSP setup in order: report-only first, nonces over whole vendor domains, a hard look at 'unsafe-eval', and honest notes for WordPress and site builders.
- Card rules, in plain EnglishPCI DSS 6.4.3 and 11.6.1: Payment Page Script Records Your Processor Can Actually ReadWhat PCI DSS 6.4.3 and 11.6.1 ask of your payment page, how your checkout setup sets scope, and the records we build. We are not a QSA and do not certify.
- Tests that stay homeServer-Side A/B Testing: Run Experiments Without Handing a Vendor Every PageServer-side A/B testing picks the version before the page is sent, so no testing script runs in the browser. When to switch, when to keep your tool.
- Everything in Website SecuritySee the section
From the Insights desk
- Why Your WordPress Form Gets Spammed — and the Fix That Doesn't Annoy Real CustomersForm spam isn't the problem — it's what the spam does: buried leads, a poisoned CRM, and an inbox you've learned to ignore. Why CAPTCHAs make it worse, and the silent fix that stops bots without costing you real customers.
- Next.js or PHP? The Better Question Is Who Patches Your SiteApache, NGINX and PHP all shipped urgent fixes between November 11 and 19, 2026. PHP is not the villain, and Next.js has patch days too. The real difference is who installs the fix, how fast, and how much of your site runs code at all.
Tell us what the script is doing
Describe where you found it, what it calls and whether it touches checkout or login pages. We reply the same business day with the first steps and a written estimate.
Which of these sounds like you? (pick any)
Rather talk now? Call (210) 346-0848.