diff --git a/spec/beef/security_checks_spec.rb b/spec/beef/security_checks_spec.rb index 9f8bf0cce..c05832311 100644 --- a/spec/beef/security_checks_spec.rb +++ b/spec/beef/security_checks_spec.rb @@ -7,7 +7,11 @@ RSpec.describe 'BeEF Security Checks' do next if %r{extensions/dns}.match(path) # skip this file f.grep(/\Weval\W/im) do |line| - raise "Illegal use of 'eval' found in\n Path: #{path}\nLine: #{line}" + # check if comment starting with the '#' character + clean_line = line.downcase.gsub(/[ ]/, "") + if clean_line[0] != '#' # check first non-whitespace position + raise "Illegal use of 'eval' found in\n Path: #{path}\nLine: #{line}" + end end end end