Giter Site home page Giter Site logo

snooper.cfc's Introduction

Snooper.cfc - A ColdFusion Component For Finding Live Variable Leaks

by Ben Nadel (on Google+)

This is a small ColdFusion component that I use, as a sanity check, to inspect other ColdFusion components that are cached in a production system. Snooper.cfc works by injecting a public method that can access the target component's private variables scope. Snooper.cfc then inspects the private variables and looks for potential variable leaks.

To inspect a component, instantiate the Snooper.cfc and call .snoop() on the target:

// Get the manifest of private variables that may be leaking.
manifest = new lib.Snooper()
	// .includeFunctions()
	// .includeComponents()
	.excludeKeys( [ "password", "secretkey", "apiKey" ] )
	.snoop( application.thing )
;

writeDump( label = "Possible Leaks", manifest );

By default, private functions and private component references are excluded from the manifest of private variables. However, you can include them if you want to be calling:

  • .includeFunctions()
  • .includeComponents()

You can also exclude arbitrary keys by passing an array of strings to:

  • .excludeKeys( arrayOfKeys )

The .snoop() method also takes an optional filter function that will exclude keys:

  • .snoop( target [, filterClosure] )

CAUTION: Never run this in "public" - always hide this behind some sort of authentication or administrative tooling. This could expose very sensitive information to anyone who can access it.

snooper.cfc's People

Contributors

bennadel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

dawesi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.