Nondeterministic Programming Methodology


    1.0.0 • Public • Published


    npm version npm downloads Travis CI Coverage Status Code Climate Grade bitHound Overall Score GitHub license

    An npm package that detects improper iframe busting code and incorrect HTTP headers. "Clickjacking" is a malicious technique of tricking users into clicking on invisible iframes, and thus performing sensitive actions like sharing data or bank transfers without their knowledge. This tool attempts to find and offer suggestions to patch these vulnerabilities in your web applications. Also included are an Electron application, Chrome extension, and an Arachni check.

    Install npm package

    $ npm install busted


    In a Node.js application (no DOM access to iframes, so only headers test is functional):

    var busted = require('busted');
    var URL = '';
    busted.headersTest(URL, function(url, passed) {
      console.log(url + (passed ? ' passed ' : ' failed ') + 'the headers test.');

    In any Electron application (has DOM access so iframes can be tested):

    window.BUSTED = require('busted.js');
    var URL = '';
    var iframe = document.getElementById('frame');
    iframe.src = URL;
    window.BUSTED.headersTest(URL, function(url, passed) {
      console.log(url + (passed ? ' passed ' : ' failed ') + 'the headers test.');
    iframe.onload = function() {
      var passed = window.BUSTED.iframeTest(URL, iframe);
      console.log(URL + (passed ? ' passed ' : ' failed ') + 'the iframe test.');

    Using our Electron app

    Our Electron app allows for scanning and testing URLs for the vulnerabilities.


    $ git clone && cd busted/electron && npm install

    Starting the app

    From busted/electron run:

    $ npm start

    Arachni Web Scanner Check

    An Arachni check that tests headers and parses JavaScript for improper frame-busting code.

    Install Arachni

    Download and install Arachni.

    Install Busted

    $ git clone

    Move the arachni/clickjacking.rb file to: [ARACHNI_DIRECTORY]/system/gems/gems/arachni-1.4/components/checks/passive from within [ARACHNI_DIRECTORY] run the following:

    $ bin/arachni --checks=clickjacking --scope-page-limit 1 --browser-cluster-pool-size 1 SOME_URL_OR_FILE

    for more information, see the Arachni CLI guide.

    Clickjacking Prevention

    There are other attacks that are site-specific or are possible if the attacker controls certian domain names. These attacks cannot be tested here, but we will attempt to prevent them with this two-fold solution.

    Headers: Set X-Frame-Options header to DENY or SAMEORIGIN

    Frame Busting Code: Use the following frame busting code as a solution for older browsers that do not support X-Frame-Options or Content-Security-Policy headers.

    <!-- Source: -->
    html { display: none; }
    if (self == top) { = 'block';
    } else {
      top.location = self.location;


    npm i busted

    DownloadsWeekly Downloads






    Last publish


    • nathanchapman