Sha256: 0af4d63bed1462f266970bc507c2fcfa81fdadbd71215f932834ab1c4c6b30a6
Contents?: true
Size: 543 Bytes
Versions: 23
Compression:
Stored size: 543 Bytes
Contents
module RuboCop module Cop module Paraxial class Constantize < Base MSG = '`constantize` methods cause remote code execution if called on user input.' 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 private def send_methods [:constantize, :safe_constantize, :const_get, :qualified_const_get] end end end end end
Version data entries
23 entries across 23 versions & 1 rubygems