Skip to content

Commit

Permalink
fix(ruby): add missing URI#read case (#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
didroe authored Apr 2, 2024
1 parent e001462 commit 43741ab
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rules/ruby/lang/http_url_using_user_input.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,15 @@ patterns:
- variable: USER_INPUT
detection: ruby_shared_common_user_input
scope: result
- pattern: $<URI>.open$<...>
- pattern: $<URI>.$<METHOD>$<...>
filters:
- variable: URI
detection: ruby_lang_http_url_using_user_input_uri
scope: cursor
- variable: METHOD
values:
- open
- read
- pattern: open($<URI>$<...>)$<...>
filters:
- variable: URI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@
open(uri, "r")
Kernel.open(uri) {}
uri.open
uri.read
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@

# bearer:expected ruby_lang_http_url_using_user_input
uri.open

# bearer:expected ruby_lang_http_url_using_user_input
uri.read

0 comments on commit 43741ab

Please sign in to comment.