brakeman 6.2.2 → 7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +17 -0
- data/bundle/load.rb +7 -6
- data/bundle/ruby/3.1.0/gems/csv-3.3.2/LICENSE.txt +33 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.2/NEWS.md +965 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.2/README.md +55 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.2/lib/csv/core_ext/array.rb +9 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.2/lib/csv/core_ext/string.rb +9 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.2/lib/csv/fields_converter.rb +96 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.2/lib/csv/input_record_separator.rb +18 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.2/lib/csv/parser.rb +1292 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.2/lib/csv/row.rb +757 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.2/lib/csv/table.rb +1055 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.2/lib/csv/version.rb +6 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.2/lib/csv/writer.rb +209 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.2/lib/csv.rb +3017 -0
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/config.rb +22 -26
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/history.rb +3 -3
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/io/ansi.rb +64 -111
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/io/dumb.rb +16 -2
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/io/windows.rb +77 -60
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/io.rb +14 -0
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/key_actor/base.rb +10 -4
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/key_actor/emacs.rb +96 -96
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/key_actor/vi_command.rb +182 -182
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/key_actor/vi_insert.rb +137 -137
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/key_stroke.rb +26 -16
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/line_editor.rb +238 -404
- data/bundle/ruby/3.1.0/gems/reline-0.6.0/lib/reline/unicode.rb +415 -0
- data/bundle/ruby/3.1.0/gems/reline-0.6.0/lib/reline/version.rb +3 -0
- data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline.rb +18 -18
- data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/NEWS.md +50 -0
- data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/parsers/baseparser.rb +54 -45
- data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/parsers/pullparser.rb +4 -0
- data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/rexml.rb +1 -1
- data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/source.rb +45 -4
- data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/text.rb +15 -40
- data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/History.rdoc +6 -0
- data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/lib/sexp.rb +1 -1
- data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/lib/sexp_processor.rb +1 -1
- data/bundle/ruby/3.1.0/gems/terminal-table-3.0.2/History.rdoc +142 -0
- data/bundle/ruby/3.1.0/gems/terminal-table-3.0.2/README.md +417 -0
- data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-3.0.2}/lib/terminal-table/cell.rb +8 -8
- data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-3.0.2}/lib/terminal-table/row.rb +18 -4
- data/bundle/ruby/3.1.0/gems/terminal-table-3.0.2/lib/terminal-table/separator.rb +66 -0
- data/bundle/ruby/3.1.0/gems/terminal-table-3.0.2/lib/terminal-table/style.rb +284 -0
- data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-3.0.2}/lib/terminal-table/table.rb +47 -18
- data/bundle/ruby/3.1.0/gems/terminal-table-3.0.2/lib/terminal-table/util.rb +13 -0
- data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-3.0.2}/lib/terminal-table/version.rb +1 -1
- data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-3.0.2}/lib/terminal-table.rb +2 -2
- data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-3.0.2}/terminal-table.gemspec +3 -3
- data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/creole.rb +2 -0
- data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/liquid.rb +0 -3
- data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/mapping.rb +3 -3
- data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/rdoc.rb +0 -8
- data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/template.rb +27 -3
- data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt.rb +1 -4
- data/bundle/ruby/3.1.0/gems/{unicode-display_width-1.8.0 → unicode-display_width-2.6.0}/CHANGELOG.md +65 -2
- data/bundle/ruby/3.1.0/gems/{unicode-display_width-1.8.0 → unicode-display_width-2.6.0}/MIT-LICENSE.txt +1 -1
- data/bundle/ruby/3.1.0/gems/{unicode-display_width-1.8.0 → unicode-display_width-2.6.0}/README.md +67 -20
- data/bundle/ruby/3.1.0/gems/unicode-display_width-2.6.0/data/display_width.marshal.gz +0 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-2.6.0/lib/unicode/display_width/constants.rb +10 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-2.6.0/lib/unicode/display_width/index.rb +34 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-2.6.0/lib/unicode/display_width/no_string_ext.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-2.6.0/lib/unicode/display_width/string_ext.rb +9 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-2.6.0/lib/unicode/display_width.rb +123 -0
- data/lib/brakeman/app_tree.rb +23 -18
- data/lib/brakeman/checks/check_deserialize.rb +4 -1
- data/lib/brakeman/checks/check_evaluation.rb +20 -2
- data/lib/brakeman/checks/check_model_attr_accessible.rb +1 -0
- data/lib/brakeman/file_parser.rb +2 -1
- data/lib/brakeman/options.rb +8 -5
- data/lib/brakeman/processors/alias_processor.rb +6 -2
- data/lib/brakeman/processors/lib/file_type_detector.rb +9 -7
- data/lib/brakeman/report/ignore/config.rb +0 -1
- data/lib/brakeman/report/report_sarif.rb +122 -2
- data/lib/brakeman/rescanner.rb +40 -390
- data/lib/brakeman/scanner.rb +62 -38
- data/lib/brakeman/tracker/file_cache.rb +83 -0
- data/lib/brakeman/tracker.rb +19 -2
- data/lib/brakeman/version.rb +1 -1
- data/lib/brakeman.rb +12 -2
- metadata +170 -160
- data/bundle/ruby/3.1.0/gems/reline-0.5.10/lib/reline/terminfo.rb +0 -158
- data/bundle/ruby/3.1.0/gems/reline-0.5.10/lib/reline/unicode.rb +0 -671
- data/bundle/ruby/3.1.0/gems/reline-0.5.10/lib/reline/version.rb +0 -3
- data/bundle/ruby/3.1.0/gems/terminal-table-1.8.0/History.rdoc +0 -85
- data/bundle/ruby/3.1.0/gems/terminal-table-1.8.0/README.rdoc +0 -247
- data/bundle/ruby/3.1.0/gems/terminal-table-1.8.0/lib/terminal-table/separator.rb +0 -14
- data/bundle/ruby/3.1.0/gems/terminal-table-1.8.0/lib/terminal-table/style.rb +0 -79
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/erubis.rb +0 -51
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/maruku.rb +0 -10
- data/bundle/ruby/3.1.0/gems/tilt-2.4.0/lib/tilt/wikicloth.rb +0 -12
- data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/data/display_width.marshal.gz +0 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/lib/unicode/display_width/constants.rb +0 -8
- data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/lib/unicode/display_width/index.rb +0 -12
- data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/lib/unicode/display_width/no_string_ext.rb +0 -7
- data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/lib/unicode/display_width/string_ext.rb +0 -17
- data/bundle/ruby/3.1.0/gems/unicode-display_width-1.8.0/lib/unicode/display_width.rb +0 -51
- /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/BSDL +0 -0
- /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/COPYING +0 -0
- /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/README.md +0 -0
- /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/face.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/key_actor/composite.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/key_actor.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/kill_ring.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/lib/reline/unicode/east_asian_width.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{reline-0.5.10 → reline-0.6.0}/license_of_rb-readline +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/LICENSE.txt +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/README.md +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/attlistdecl.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/attribute.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/cdata.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/child.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/comment.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/doctype.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/document.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/dtd/attlistdecl.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/dtd/dtd.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/dtd/elementdecl.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/dtd/entitydecl.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/dtd/notationdecl.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/element.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/encoding.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/entity.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/formatters/default.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/formatters/pretty.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/formatters/transitive.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/functions.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/instruction.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/light/node.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/namespace.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/node.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/output.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/parent.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/parseexception.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/parsers/lightparser.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/parsers/sax2parser.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/parsers/streamparser.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/parsers/treeparser.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/parsers/ultralightparser.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/parsers/xpathparser.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/quickpath.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/sax2listener.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/security.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/streamlistener.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/undefinednamespaceexception.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/validation/relaxng.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/validation/validation.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/validation/validationexception.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/xmldecl.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/xmltokens.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/xpath.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml/xpath_parser.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{rexml-3.3.8 → rexml-3.4.0}/lib/rexml.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/Manifest.txt +0 -0
- /data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/README.rdoc +0 -0
- /data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/lib/composite_sexp_processor.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/lib/pt_testcase.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/lib/sexp_matcher.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/lib/strict_sexp.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{sexp_processor-4.17.2 → sexp_processor-4.17.3}/lib/unique.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-3.0.2}/Gemfile +0 -0
- /data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-3.0.2}/LICENSE.txt +0 -0
- /data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-3.0.2}/Manifest +0 -0
- /data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-3.0.2}/Todo.rdoc +0 -0
- /data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-3.0.2}/lib/terminal-table/import.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{terminal-table-1.8.0 → terminal-table-3.0.2}/lib/terminal-table/table_helper.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/COPYING +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/_emacs_org.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/_handlebars.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/_jbuilder.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/_org.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/asciidoc.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/babel.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/builder.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/cli.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/coffee.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/commonmarker.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/csv.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/erb.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/erubi.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/etanni.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/haml.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/kramdown.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/livescript.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/markaby.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/nokogiri.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/pandoc.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/pipeline.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/plain.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/prawn.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/radius.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/rdiscount.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/redcarpet.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/redcloth.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/rst-pandoc.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/sass.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/slim.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/string.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/typescript.rb +0 -0
- /data/bundle/ruby/3.1.0/gems/{tilt-2.4.0 → tilt-2.5.0}/lib/tilt/yajl.rb +0 -0
data/lib/brakeman/scanner.rb
CHANGED
@@ -7,6 +7,7 @@ begin
|
|
7
7
|
require 'brakeman/file_parser'
|
8
8
|
require 'brakeman/parsers/template_parser'
|
9
9
|
require 'brakeman/processors/lib/file_type_detector'
|
10
|
+
require 'brakeman/tracker/file_cache'
|
10
11
|
rescue LoadError => e
|
11
12
|
$stderr.puts e.message
|
12
13
|
$stderr.puts "Please install the appropriate dependency."
|
@@ -38,6 +39,10 @@ class Brakeman::Scanner
|
|
38
39
|
@processor.tracked_events
|
39
40
|
end
|
40
41
|
|
42
|
+
def file_cache
|
43
|
+
tracker.file_cache
|
44
|
+
end
|
45
|
+
|
41
46
|
def process_step description
|
42
47
|
Brakeman.notify "#{description}...".ljust(40)
|
43
48
|
|
@@ -67,7 +72,7 @@ class Brakeman::Scanner
|
|
67
72
|
end
|
68
73
|
|
69
74
|
#Process everything in the Rails application
|
70
|
-
def process
|
75
|
+
def process(ruby_paths: nil, template_paths: nil)
|
71
76
|
process_step 'Processing gems' do
|
72
77
|
process_gems
|
73
78
|
end
|
@@ -77,14 +82,30 @@ class Brakeman::Scanner
|
|
77
82
|
process_config
|
78
83
|
end
|
79
84
|
|
85
|
+
# -
|
86
|
+
# If ruby_paths or template_paths are set,
|
87
|
+
# only parse those files. The rest will be fetched
|
88
|
+
# from the file cache.
|
89
|
+
#
|
90
|
+
# Otherwise, parse everything normally.
|
91
|
+
#
|
92
|
+
astfiles = nil
|
93
|
+
process_step 'Finding files' do
|
94
|
+
ruby_paths ||= tracker.app_tree.ruby_file_paths
|
95
|
+
template_paths ||= tracker.app_tree.template_paths
|
96
|
+
end
|
97
|
+
|
80
98
|
process_step 'Parsing files' do
|
81
|
-
parse_files
|
99
|
+
astfiles = parse_files(ruby_paths: ruby_paths, template_paths: template_paths)
|
82
100
|
end
|
83
101
|
|
84
102
|
process_step 'Detecting file types' do
|
85
|
-
detect_file_types
|
103
|
+
detect_file_types(astfiles)
|
86
104
|
end
|
87
105
|
|
106
|
+
tracker.save_file_cache! if support_rescanning?
|
107
|
+
# -
|
108
|
+
|
88
109
|
process_step 'Processing initializers' do
|
89
110
|
process_initializers
|
90
111
|
end
|
@@ -124,44 +145,37 @@ class Brakeman::Scanner
|
|
124
145
|
tracker
|
125
146
|
end
|
126
147
|
|
127
|
-
def parse_files
|
148
|
+
def parse_files(ruby_paths:, template_paths:)
|
128
149
|
fp = Brakeman::FileParser.new(tracker.app_tree, tracker.options[:parser_timeout], tracker.options[:parallel_checks], tracker.options[:use_prism])
|
129
150
|
|
130
|
-
fp.parse_files
|
151
|
+
fp.parse_files ruby_paths
|
131
152
|
|
132
153
|
template_parser = Brakeman::TemplateParser.new(tracker, fp)
|
133
154
|
|
134
|
-
fp.read_files(
|
135
|
-
template_parser.parse_template
|
155
|
+
fp.read_files(template_paths) do |path, contents|
|
156
|
+
template_parser.parse_template(path, contents)
|
136
157
|
end
|
137
158
|
|
138
159
|
# Collect errors raised during parsing
|
139
160
|
tracker.add_errors(fp.errors)
|
140
161
|
|
141
|
-
|
162
|
+
fp.file_list
|
142
163
|
end
|
143
164
|
|
144
|
-
def detect_file_types
|
145
|
-
@file_list = {
|
146
|
-
controllers: [],
|
147
|
-
initializers: [],
|
148
|
-
libs: [],
|
149
|
-
models: [],
|
150
|
-
templates: [],
|
151
|
-
}
|
152
|
-
|
165
|
+
def detect_file_types(astfiles)
|
153
166
|
detector = Brakeman::FileTypeDetector.new
|
154
167
|
|
155
|
-
|
168
|
+
astfiles.each do |file|
|
156
169
|
if file.is_a? Brakeman::TemplateParser::TemplateFile
|
157
|
-
|
170
|
+
file_cache.add_file file, :template
|
158
171
|
else
|
159
172
|
type = detector.detect_type(file)
|
173
|
+
|
160
174
|
unless type == :skip
|
161
|
-
if
|
162
|
-
|
175
|
+
if file_cache.valid_type? type
|
176
|
+
file_cache.add_file(file, type)
|
163
177
|
else
|
164
|
-
|
178
|
+
raise "Unexpected file type: #{type.inspect}"
|
165
179
|
end
|
166
180
|
end
|
167
181
|
end
|
@@ -268,8 +282,8 @@ class Brakeman::Scanner
|
|
268
282
|
#
|
269
283
|
#Adds parsed information to tracker.initializers
|
270
284
|
def process_initializers
|
271
|
-
track_progress
|
272
|
-
process_step_file
|
285
|
+
track_progress file_cache.initializers do |path, init|
|
286
|
+
process_step_file path do
|
273
287
|
process_initializer init
|
274
288
|
end
|
275
289
|
end
|
@@ -289,8 +303,10 @@ class Brakeman::Scanner
|
|
289
303
|
return
|
290
304
|
end
|
291
305
|
|
292
|
-
|
293
|
-
|
306
|
+
libs = file_cache.libs.sort_by { |path, _| path }
|
307
|
+
|
308
|
+
track_progress libs do |path, lib|
|
309
|
+
process_step_file path do
|
294
310
|
process_lib lib
|
295
311
|
end
|
296
312
|
end
|
@@ -322,15 +338,17 @@ class Brakeman::Scanner
|
|
322
338
|
#
|
323
339
|
#Adds processed controllers to tracker.controllers
|
324
340
|
def process_controllers
|
325
|
-
|
326
|
-
|
341
|
+
controllers = file_cache.controllers.sort_by { |path, _| path }
|
342
|
+
|
343
|
+
track_progress controllers do |path, controller|
|
344
|
+
process_step_file path do
|
327
345
|
process_controller controller
|
328
346
|
end
|
329
347
|
end
|
330
348
|
end
|
331
349
|
|
332
350
|
def process_controller_data_flows
|
333
|
-
controllers = tracker.controllers.sort_by { |name, _| name
|
351
|
+
controllers = tracker.controllers.sort_by { |name, _| name }
|
334
352
|
|
335
353
|
track_progress controllers, "controllers" do |name, controller|
|
336
354
|
process_step_file name do
|
@@ -356,10 +374,10 @@ class Brakeman::Scanner
|
|
356
374
|
#
|
357
375
|
#Adds processed views to tracker.views
|
358
376
|
def process_templates
|
359
|
-
templates =
|
377
|
+
templates = file_cache.templates.sort_by { |path, _| path }
|
360
378
|
|
361
|
-
track_progress templates, "templates" do |template|
|
362
|
-
process_step_file
|
379
|
+
track_progress templates, "templates" do |path, template|
|
380
|
+
process_step_file path do
|
363
381
|
process_template template
|
364
382
|
end
|
365
383
|
end
|
@@ -370,7 +388,7 @@ class Brakeman::Scanner
|
|
370
388
|
end
|
371
389
|
|
372
390
|
def process_template_data_flows
|
373
|
-
templates = tracker.templates.sort_by { |name, _| name
|
391
|
+
templates = tracker.templates.sort_by { |name, _| name }
|
374
392
|
|
375
393
|
track_progress templates, "templates" do |name, template|
|
376
394
|
process_step_file name do
|
@@ -383,15 +401,17 @@ class Brakeman::Scanner
|
|
383
401
|
#
|
384
402
|
#Adds the processed models to tracker.models
|
385
403
|
def process_models
|
386
|
-
|
387
|
-
|
388
|
-
|
404
|
+
models = file_cache.models.sort_by { |path, _| path }
|
405
|
+
|
406
|
+
track_progress models do |path, model|
|
407
|
+
process_step_file path do
|
408
|
+
process_model model
|
389
409
|
end
|
390
410
|
end
|
391
411
|
end
|
392
412
|
|
393
|
-
def process_model
|
394
|
-
@processor.process_model(ast, path)
|
413
|
+
def process_model astfile
|
414
|
+
@processor.process_model(astfile.ast, astfile.path)
|
395
415
|
end
|
396
416
|
|
397
417
|
def track_progress list, type = "files"
|
@@ -420,6 +440,10 @@ class Brakeman::Scanner
|
|
420
440
|
tracker.error(e)
|
421
441
|
nil
|
422
442
|
end
|
443
|
+
|
444
|
+
def support_rescanning?
|
445
|
+
tracker.options[:support_rescanning]
|
446
|
+
end
|
423
447
|
end
|
424
448
|
|
425
449
|
# This is to allow operation without loading the Haml library
|
@@ -0,0 +1,83 @@
|
|
1
|
+
module Brakeman
|
2
|
+
class FileCache
|
3
|
+
def initialize(file_list = nil)
|
4
|
+
@file_list = file_list || {
|
5
|
+
controller: {},
|
6
|
+
initializer: {},
|
7
|
+
lib: {},
|
8
|
+
model: {},
|
9
|
+
template: {},
|
10
|
+
}
|
11
|
+
end
|
12
|
+
|
13
|
+
def controllers
|
14
|
+
@file_list[:controller]
|
15
|
+
end
|
16
|
+
|
17
|
+
def initializers
|
18
|
+
@file_list[:initializer]
|
19
|
+
end
|
20
|
+
|
21
|
+
def libs
|
22
|
+
@file_list[:lib]
|
23
|
+
end
|
24
|
+
|
25
|
+
def models
|
26
|
+
@file_list[:model]
|
27
|
+
end
|
28
|
+
|
29
|
+
def templates
|
30
|
+
@file_list[:template]
|
31
|
+
end
|
32
|
+
|
33
|
+
def add_file(astfile, type)
|
34
|
+
raise "Unknown type: #{type}" unless valid_type? type
|
35
|
+
@file_list[type][astfile.path] = astfile
|
36
|
+
end
|
37
|
+
|
38
|
+
def valid_type?(type)
|
39
|
+
@file_list.key? type
|
40
|
+
end
|
41
|
+
|
42
|
+
def cached? path
|
43
|
+
@file_list.any? do |name, list|
|
44
|
+
list[path]
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def delete path
|
49
|
+
@file_list.each do |name, list|
|
50
|
+
list.delete path
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def diff other
|
55
|
+
@file_list.each do |name, list|
|
56
|
+
other_list = other.send(:"#{name}s")
|
57
|
+
|
58
|
+
if list == other_list
|
59
|
+
next
|
60
|
+
else
|
61
|
+
puts "-- #{name} --"
|
62
|
+
puts "Old: #{other_list.keys - list.keys}"
|
63
|
+
puts "New: #{list.keys - other_list.keys}"
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def dup
|
69
|
+
copy_file_list = @file_list.map do |name, list|
|
70
|
+
copy_list = list.map do |path, astfile|
|
71
|
+
copy_astfile = astfile.dup
|
72
|
+
copy_astfile.ast = copy_astfile.ast.deep_clone
|
73
|
+
|
74
|
+
[path, copy_astfile]
|
75
|
+
end.to_h
|
76
|
+
|
77
|
+
[name, copy_list]
|
78
|
+
end.to_h
|
79
|
+
|
80
|
+
FileCache.new(copy_file_list)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
data/lib/brakeman/tracker.rb
CHANGED
@@ -12,7 +12,7 @@ class Brakeman::Tracker
|
|
12
12
|
attr_accessor :controllers, :constants, :templates, :models, :errors,
|
13
13
|
:checks, :initializers, :config, :routes, :processor, :libs,
|
14
14
|
:template_cache, :options, :filter_cache, :start_time, :end_time,
|
15
|
-
:duration, :ignored_filter, :app_tree
|
15
|
+
:duration, :ignored_filter, :app_tree, :file_cache, :pristine_file_cache
|
16
16
|
|
17
17
|
#Place holder when there should be a model, but it is not
|
18
18
|
#clear what model it will be.
|
@@ -26,15 +26,22 @@ class Brakeman::Tracker
|
|
26
26
|
@app_tree = app_tree
|
27
27
|
@processor = processor
|
28
28
|
@options = options
|
29
|
+
@file_cache = Brakeman::FileCache.new
|
30
|
+
@pristine_file_cache = nil
|
29
31
|
|
30
|
-
|
32
|
+
reset_all
|
33
|
+
end
|
34
|
+
|
35
|
+
def reset_all
|
31
36
|
@templates = {}
|
32
37
|
@controllers = {}
|
38
|
+
|
33
39
|
#Initialize models with the unknown model so
|
34
40
|
#we can match models later without knowing precisely what
|
35
41
|
#class they are.
|
36
42
|
@models = {}
|
37
43
|
@models[UNKNOWN_MODEL] = Brakeman::Model.new(UNKNOWN_MODEL, nil, @app_tree.file_path("NOT_REAL.rb"), nil, self)
|
44
|
+
|
38
45
|
@method_cache = {}
|
39
46
|
@routes = {}
|
40
47
|
@initializers = {}
|
@@ -46,11 +53,16 @@ class Brakeman::Tracker
|
|
46
53
|
@template_cache = Set.new
|
47
54
|
@filter_cache = {}
|
48
55
|
@call_index = nil
|
56
|
+
@config = Brakeman::Config.new(self)
|
49
57
|
@start_time = Time.now
|
50
58
|
@end_time = nil
|
51
59
|
@duration = nil
|
52
60
|
end
|
53
61
|
|
62
|
+
def save_file_cache!
|
63
|
+
@pristine_file_cache = @file_cache.dup
|
64
|
+
end
|
65
|
+
|
54
66
|
#Add an error to the list. If no backtrace is given,
|
55
67
|
#the one from the exception will be used.
|
56
68
|
def error exception, backtrace = nil
|
@@ -301,6 +313,11 @@ class Brakeman::Tracker
|
|
301
313
|
method_sets << self.controllers
|
302
314
|
end
|
303
315
|
|
316
|
+
if locations.include? :libs
|
317
|
+
classes_to_reindex.merge self.libs.keys
|
318
|
+
method_sets << self.libs
|
319
|
+
end
|
320
|
+
|
304
321
|
if locations.include? :initializers
|
305
322
|
self.initializers.each do |file_name, src|
|
306
323
|
@call_index.remove_indexes_by_file file_name
|
data/lib/brakeman/version.rb
CHANGED
data/lib/brakeman.rb
CHANGED
@@ -84,6 +84,15 @@ module Brakeman
|
|
84
84
|
options[:report_progress] = false
|
85
85
|
end
|
86
86
|
|
87
|
+
if options[:use_prism]
|
88
|
+
begin
|
89
|
+
require 'prism'
|
90
|
+
notify '[Notice] Using Prism parser'
|
91
|
+
rescue LoadError => e
|
92
|
+
Brakeman.debug "[Notice] Asked to use Prism, but failed to load: #{e}"
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
87
96
|
scan options
|
88
97
|
end
|
89
98
|
|
@@ -196,6 +205,7 @@ module Brakeman
|
|
196
205
|
:pager => true,
|
197
206
|
:parallel_checks => true,
|
198
207
|
:parser_timeout => 10,
|
208
|
+
:use_prism => true,
|
199
209
|
:relative_path => false,
|
200
210
|
:report_progress => true,
|
201
211
|
:safe_methods => Set.new,
|
@@ -464,12 +474,12 @@ module Brakeman
|
|
464
474
|
def self.rescan tracker, files, options = {}
|
465
475
|
require 'brakeman/rescanner'
|
466
476
|
|
467
|
-
tracker.options.merge
|
477
|
+
options = tracker.options.merge options
|
468
478
|
|
469
479
|
@quiet = !!tracker.options[:quiet]
|
470
480
|
@debug = !!tracker.options[:debug]
|
471
481
|
|
472
|
-
Rescanner.new(
|
482
|
+
Rescanner.new(options, tracker.processor, files).recheck
|
473
483
|
end
|
474
484
|
|
475
485
|
def self.notify message
|