JavaScript Supply Chain Attack Example - URL/IFRAME Re-writing

This page provides a short and simple example of JavaScript's capability to hijack (re-write) a hardcoded URL (or IFRAME).

What To Expect

This page presents two links that will open in new tabs when clicked. One link is left alone but the Wikipedia link will be hijacked to a spoof site!


Checking It Out - Under the Covers

You can check out the link as follows:

Simple Demonstration of Risk

This is not intended to be a full-function URL hijacker and omits many of the polish and evasion methods used by criminal gangs in e-commerce skimmers. Normally a skimmer would simply include a JavaScript via a link (below) - We've left this as inline script for clarity and simplicity:

<script src=""></script>

Our example is deliberately minimalistic. We wanted an example that was clear, uncluttered, and free of excesses. This is provided on a stand-alone page without styles, branding, or other trappings of a modern web site. No server is needed and you could run this from a file on your desktop.

In the case of a real skimmer, no amount of inspection of your web host or your source will find the problem. You need to look at the third party site! Most shopping carts include third party scripts from dozens of URLs - every one a potential risk. Your entire site could be housed on an optical drive with continuous file integrity checking and you would not detect a change of code on a third party site. This effectively demonstrates the risks of using third party scripts you have no controls over.