From: "postmodern (Hal Brodigan)" Date: 2012-05-08T14:18:27+09:00 Subject: [ruby-core:44934] [ruby-trunk - Feature #6409] public_send is easily bypassed Issue #6409 has been updated by postmodern (Hal Brodigan). (({public_send})) should only allow _calling_ public methods. By extension, it should not allow calling (({send})), since that would negate the purpose of (({public_send})). In the context of (({public_send})), the (({send})) method has special meaning. ---------------------------------------- Feature #6409: public_send is easily bypassed https://bugs.ruby-lang.org/issues/6409#change-26522 Author: postmodern (Hal Brodigan) Status: Open Priority: Normal Assignee: Category: core Target version: 2.0.0 =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/