You must bind the binding by calling the method taint.
$SAFE - Ruby, . , , , , HTTP- ..
$SAFE 1, , Ruby require, .
$SAFE 4 . Ruby . , $SAFE proc $SAFE 4. tainted strong > .
ERB , . , :
class TemplateContext
def name; "Teflon Ted"; end
end
template_binding = TemplateContext.new.send(:binding)
ERB.new("Hi, <%= name %>!", 4).result(template_binding)
Blam!. Ruby, , $SAFE 4. eval ( ERB).
tainted. Ruby, .
class TemplateContext
def name; "Teflon Ted"; end
end
template_binding = TemplateContext.new.send(:binding).taint
ERB.new("Hi, <%= name %>!", 4).result(template_binding)
Ruby $SAFE . Pickaxe.