ForumsResourcesSupply Chain Attack: Adform Script Poisoning & Crypto Address Swapping

Supply Chain Attack: Adform Script Poisoning & Crypto Address Swapping

Support 8/1/2026 MOD

Just caught the report on the Adform incident from July 27. It looks like attackers managed to poison a JavaScript file served by the adtech giant, effectively turning it into a client-side crypto wallet swapper. This is a textbook Magecart-style supply chain attack.

The mechanics are insidious: the script monitors the DOM or clipboard events. When a user copies a Bitcoin address on a compromised site, the script intercepts the action and swaps the address with the attacker's before the paste occurs. Because the malicious code originates from a trusted domain (adform.com or similar), standard content filters often let it right through.

This highlights the massive risk of third-party tags. If you aren't already, you need to be implementing Subresource Integrity (SRI) for critical scripts, though I know that's a nightmare with ad platforms that update assets hourly.

For those doing incident response or forensics on this, you might want to scan your cached JS files for clipboard event hooks. Here is a quick Python snippet to hunt for suspicious listeners in local assets:

import re
import os

# Regex for clipboard events and potential address replacement logic
clipboard_pattern = re.compile(r'(document\.addEventListener.*(?i)copy|oncopy)', re.IGNORECASE)
replace_pattern = re.compile(r'(replace|slice|substring).*value', re.IGNORECASE)

def scan_js_directory(directory):
    for root, dirs, files in os.walk(directory):
        for file in files:
            if file.endswith('.js'):
                path = os.path.join(root, file)
                try:
                    with open(path, 'r', encoding='utf-8', errors='ignore') as f:
                        content = f.read()
                        if clipboard_pattern.search(content):
                            print(f"[!] Clipboard event found in: {path}")
                            if replace_pattern.search(content):
                                print(f"    [WARNING] Potential string replacement logic detected.")
                except Exception as e:
                    continue

scan_js_directory('./downloaded_js_assets')

Given the frequency of these updates, how are you all balancing the need for ad revenue/marketing pixels with the security risk of these supply chain attacks? Is CSP strict-dynamic the only way forward?

DE
DevSecOps_Lin8/1/2026

We saw a similar spike in anomalous JS behavior last month. We started enforcing a report-uri in our Content-Security-Policy headers to monitor violations without blocking production traffic initially. It's a good middle ground; you get the telemetry to show the marketing team why their new tag is dangerous before you pull the plug.

PH
PhysSec_Marcus8/1/2026

SRI is definitely the technical answer, but as you noted, dynamic ad scripts make it nearly impossible to maintain valid hashes. We've moved to a 'sandbox' approach for all third-party scripts using sandbox="allow-scripts allow-same-origin". It doesn't stop data exfiltration entirely, but it limits the damage they can do to the rest of the DOM.

MF
MFA_Champion_Sasha8/1/2026

Great snippet, thanks. On the detection side, we've had success monitoring for 'document.execCommand("copy")' calls in our RUM (Real User Monitoring) data. It's rare for a legitimate ad script to trigger a clipboard copy programmatically. If you see that spike, you know something is wrong immediately.

Verified Access Required

To maintain the integrity of our intelligence feeds, only verified partners and security professionals can post replies.

Request Access

Thread Stats

Created8/1/2026
Last Active8/1/2026
Replies3
Views166