Client
A UK online investment platform with around 600,000 customer accounts and a web front end built in-house
Sector
Financial services
Engagement
Script inventory, content security policy, sandboxing, vendor removal drill - eight-week programme.
What the client needed
The platform had strong login controls, a mature release process and regular penetration tests of its own code. None of that covered the 40-odd third-party scripts that had accumulated on its pages over six years: analytics, session replay, chat, a performance monitor, tag management and consent tooling. After a wallet-draining script hijack at a prediction market in late October, the board asked a plain question: could that happen to us, and how would we know?
How we worked
- Crawled every page behind login with a recording browser and listed each script, its origin, who loaded it and what it could read.
- Asked each product owner to justify each script in one sentence; anything without an owner was switched off in a staging copy first.
- Removed all third-party code from the order, transfer and withdrawal screens, and moved analytics there to events sent from the server.
- Pinned versions and added integrity hashes for what remained, and replaced a broad CDN allow-list with a narrow content security policy.
- Put the unavoidable vendors in isolated frames, with a user-readable confirmation step for any money-moving action.
- Added a five-minute check that hashes every external file as served and alerts on change, and rehearsed pulling a vendor out in under ten minutes.
Measured results
Results confirmed with the client. Names, counts and platform details withheld in line with our standard confidentiality terms.
- Third-party scripts on authenticated pages fell from 43 to 11, and none remain on money-moving screens.
- Every remaining script is pinned or integrity-checked, or isolated in a frame with no access to the page's session.
- The drill to remove a named vendor from production dropped from a two-day release cycle to eight minutes.
- The file-change check caught a marketing-tag update that nobody had announced in its first fortnight, which turned out to be harmless but had gone unseen for years.
- Page weight on logged-in screens dropped by roughly a fifth, a benefit the product team had not expected.
"We had tested our code to death. It never crossed our minds that the code we hadn't written had the same keys."
Working on something similar?
If this engagement looks like the kind of problem you are facing, we would be glad to compare notes by email.
Context and constraints
The platform could not freeze releases for the exercise, so the work ran alongside normal delivery. Marketing needed conversion measurement kept, and compliance needed consent tooling to stay. Every removal therefore needed a replacement or an explicit sign-off.
What prompted it
The trigger was the Polymarket incident. The Hacker News reported that a DebugBear monitoring script on the site was replaced after a registrar-level DNS compromise, and that the injected code sold or moved traders' positions using the access already present in their open sessions. Hudson Rock's analysis found no theft of passwords or keys, which made the client's existing credential controls beside the point.
Where the surprises were
The longest argument was about session replay, which three teams used and none owned. Another script was loading a second vendor's script, which loaded a third. Nobody had a list because nobody had ever needed one. The cheapest win was dull: a font-loading script left from a redesign, still running on every page.
Lessons learned
First, the register matters more than any tool. Second, if you cannot name who owns a script, you cannot defend it. Third, practise the removal; the first drill took forty minutes and exposed a missing approval step. If you want to see what runs on your own signed-in pages, email sales@halfteck.com.