From: "postmodern (Hal Brodigan)" Date: 2012-05-08T09:37:39+09:00 Subject: [ruby-core:44929] [ruby-trunk - Bug #6409][Open] public_send is easily bypassed Issue #6409 has been reported by postmodern (Hal Brodigan). ---------------------------------------- Bug #6409: public_send is easily bypassed https://bugs.ruby-lang.org/issues/6409 Author: postmodern (Hal Brodigan) Status: Open Priority: Normal Assignee: Category: core Target version: 2.0.0 ruby -v: ruby 2.0.0dev (2012-05-08 trunk 35584) [x86_64-linux] =begin (({public_send})) can easily be bypassed, by using it to call (({send})). (({public_send})) should explicitly not allow calling (({send})). class Test private def secret "top secret" end end t = Test.new t.public_send(:secret) # => NoMethodError: private method `secret' called for # t.public_send(:send, :secret) # => "top secret" t.public_send(:send, :exec, "rm -rf ~") =end -- http://bugs.ruby-lang.org/