Skip to content

Instantly share code, notes, and snippets.

View oreoshake's full-sized avatar
:octocat:
I used to make it easier to develop this site securely

Neil Matatall oreoshake

:octocat:
I used to make it easier to develop this site securely
View GitHub Profile
@oreoshake
oreoshake / canvas-exif-stripper.html
Created November 10, 2015 00:38
Take a file input, paint the image to a canvas, display it, read the canvas data, and POST the canvas data as an image file.
<input type="file" id="input"><br>
<img id="output">
<canvas id="canvas" style="display:none"></canvas>
<script>
// from http://stackoverflow.com/questions/19032406/convert-html5-canvas-into-file-to-be-uploaded
function uploadCanvas(dataURL) {
var blobBin = atob(dataURL.split(',')[1]);
var array = [];
for(var i = 0; i < blobBin.length; i++) {
@oreoshake
oreoshake / iz_i_vulnerable.rb
Last active December 2, 2015 01:18
Audit an organization for known vulnerable gems
require 'rubygems'
require 'octokit'
require 'bundler/audit/cli'
require 'bundler/audit/database'
require 'parallel'
Bundler::Audit::CLI.new.update
ORG = ARGV[0] || "github"
@oreoshake
oreoshake / ddd
Created December 14, 2015 19:56
ddd
ddd

Credentials: I created the secure_headers library which essentially does the same thing. I also built the scala library in use at twitter today.

secure_headers used to have to_json/from_json functionality (pull request) but I removed it when I rewrote the library (for use at GitHub). This implementation would not be compatible with my implementation which was inspired by this proposal.

JSON structure

I think it would be better to collapse all directive source lists to a flat structure. i.e. instead of having sub elements for "allow" (an array), "self" (boolean), "unsafe-inline" (boolean), "unsafe-eval" (boolean), just have a directive accept an array containing those values. This model matches the spec more closely and in my experience just creates more confusion. While it does have the benefit of validation (against types like unsafe-inli

Keybase proof

I hereby claim:

  • I am oreoshake on github.
  • I am oreoshake (https://keybase.io/oreoshake) on keybase.
  • I have a public key ASD4N6g__7GEtuosEF4aKnCo2xivSd0DBYPcuzSKD4HQbgo

To claim this, I am signing this object:

@oreoshake
oreoshake / paranoidmode.md
Last active April 23, 2016 17:37
An idea for a terrible feature that dreams of becoming a reality (Maybe 5 sites on the internet would work, including GitHub)
  • No inline script
  • no eval
  • no mixed content
  • https required
  • no referrer leaks
  • no tabnabbing
  • no cross origin framing
  • no cross window/tab references
  • no unpinned certs
  • no non-Sri resources
@oreoshake
oreoshake / output
Last active May 10, 2016 21:15
Using rbenv, I'm trying to use rails 5.1.0-alpha but something is fucked
[Neils-MacBook-Pro rails (master *>)]$ rbenv rehash
[Neils-MacBook-Pro rails (master *>)]$ which rails
/Users/neil/.rbenv/shims/rails
[Neils-MacBook-Pro rails (master *>)]$ which gem
/Users/neil/.rbenv/shims/gem
[Neils-MacBook-Pro rails (master *>)]$ rails -v
Rails 4.2.6
[Neils-MacBook-Pro rails (master *>)]$ gem uninstall rails
Select gem to uninstall:
@oreoshake
oreoshake / chatops.rb
Last active June 1, 2016 22:12
HackerOne -> GitHub chatops code
#!/usr/bin/env shell-ruby
#/ Usage: gh-bounty-writeup hackerone_issue_id github_username [issues_repo] [writeup_repo]
#/
require "bounty"
raise("HACKERONE_TOKEN must be set") unless ENV["HACKERONE_TOKEN"]
raise("HACKERONE_TOKEN_NAME must be set") unless ENV["HACKERONE_TOKEN_NAME"]
usage = File.read(__FILE__).lines[1][3..-1]
@oreoshake
oreoshake / gemnasium_support.rb
Created June 21, 2016 01:34
Seeing which GitHub projects can be monitored by Gemnasium
require 'octokit'
require 'parallel'
DEPENDENCY_FILES = %w(
Gemfile
Gemfile.lock
package.json
bower.json
composer.json
requirements.txt

asdffffff