Skip to content

Instantly share code, notes, and snippets.

View alxndr's full-sized avatar

Alexander Quine alxndr

View GitHub Profile
#!/usr/bin/env ruby
#
# Proof-of-Concept exploit for Rails Remote Code Execution (CVE-2013-0156)
#
# ## Advisory
#
# https://groups.google.com/forum/#!topic/rubyonrails-security/61bkgvnSGTQ/discussion
#
# ## Caveats
#
@alxndr
alxndr / factories_spec.rb
Last active November 24, 2015 20:16
test FactoryGirl factories (including uniqueness)
require 'spec_helper'
non_idempotent_factories = [:the_president] # singletons
broken_factories = [] # just in case
FactoryGirl.factories.map(&:name).reject{|factory_sym| broken_factories.include? factory_sym}.each do |factory_sym|
factory_name = factory_sym.to_s.camelize
describe "The #{factory_name} factory" do
let(:first) { FactoryGirl.build factory_sym }