Class: RuboCop::Cop::Paraxial::Constantize
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Paraxial::Constantize
- Defined in:
- lib/rubocop/cop/paraxial/constantize.rb
Constant Summary collapse
- MSG =
'`constantize` methods cause remote code execution if called on user input.'
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/rubocop/cop/paraxial/constantize.rb', line 7 def on_send(node) method_name = node.method_name return unless send_methods.include?(method_name) add_offense(node, message: format(MSG, method: method_name)) end |