Skip to content

Commit 292087c

Browse files
committed
Add check for modules registering a DEBUG option
1 parent 88ed840 commit 292087c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tools/msftidy.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,15 @@ def check_print_debug
610610
end
611611
end
612612

613+
# Check for modules registering the DEBUG datastore option
614+
#
615+
# @see https://github.com/rapid7/metasploit-framework/issues/3816
616+
def check_datastore_debug
617+
if @source =~ /Opt.*\.new\('(?i)DEBUG(?-i)'/
618+
error('Please don\'t register a DEBUG datastore option, it has an special meaning and is used for development')
619+
end
620+
end
621+
613622
private
614623

615624
def load_file(file)
@@ -660,6 +669,7 @@ def run_checks(full_filepath)
660669
tidy.check_udp_sock_get
661670
tidy.check_invalid_url_scheme
662671
tidy.check_print_debug
672+
tidy.check_datastore_debug
663673
return tidy
664674
end
665675

0 commit comments

Comments
 (0)