Skip to content

Commit

Permalink
feat: narrow down the scope of variable reconciliation (#205)
Browse files Browse the repository at this point in the history
* feat: narrow down variable reconiciliation cope

* test: update test snapshots

* test: add simple detection confirmation

* Update pkg/parser/datatype/merge.go

Co-authored-by: David Roe <didroe@gmail.com>

* fix: rebuild test

* fix: tests

Co-authored-by: David Roe <didroe@gmail.com>
  • Loading branch information
vjerci and didroe committed Dec 7, 2022
1 parent 005d736 commit 5fd29f2
Show file tree
Hide file tree
Showing 10 changed files with 117 additions and 649 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,6 @@ risks:
parent:
line_number: 2
content: cookies.signed[:info] = user.email
- name: Firstname
stored: false
locations:
- filename: testdata/ruby/detect_rails_cookies.rb
line_number: 5
parent:
line_number: 8
content: 'cookies[:login] = { value: user_1.to_json, expires: 1.hour, secure: true }'
- name: Lastname
stored: false
locations:
- filename: testdata/ruby/detect_rails_cookies.rb
line_number: 6
parent:
line_number: 8
content: 'cookies[:login] = { value: user_1.to_json, expires: 1.hour, secure: true }'
- name: Physical Address
stored: false
locations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ risks:
- filename: testdata/ruby/detect_rails_jwt.rb
line_number: 10
parent:
line_number: 12
content: JWT.encode(user.email, nil, "none")
line_number: 10
content: JWT.encode user.address, nil, "none"
components: []


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ risks:
- filename: testdata/ruby/ruby_file_detection.rb
line_number: 5
parent:
line_number: 20
line_number: 1
content: |-
CSV.generate do |csv|
csv << ["email", "first_name", "last_name"]
CSV.open("path/to/user.csv", "wb") do |csv|
csv << ["email", "first_name", "last_name"]
users.each do |user|
csv << [
user.email,
Expand Down Expand Up @@ -94,10 +94,10 @@ risks:
- filename: testdata/ruby/ruby_file_detection.rb
line_number: 6
parent:
line_number: 20
line_number: 1
content: |-
CSV.generate do |csv|
csv << ["email", "first_name", "last_name"]
CSV.open("path/to/user.csv", "wb") do |csv|
csv << ["email", "first_name", "last_name"]
users.each do |user|
csv << [
user.email,
Expand Down Expand Up @@ -137,10 +137,10 @@ risks:
- filename: testdata/ruby/ruby_file_detection.rb
line_number: 7
parent:
line_number: 20
line_number: 1
content: |-
CSV.generate do |csv|
csv << ["email", "first_name", "last_name"]
CSV.open("path/to/user.csv", "wb") do |csv|
csv << ["email", "first_name", "last_name"]
users.each do |user|
csv << [
user.email,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,6 @@ risks:
parent:
line_number: 7
content: URI.encode_www_form(user_1)
- filename: testdata/ruby/ruby_http_detection.rb
line_number: 12
parent:
line_number: 110
content: HTTPX.get("https://my.api.com/users/search?first_name=#{user_2.first_name}")
- detector_id: ruby_http_post_detection
data_types:
- name: Ethnic Origin
Expand Down

0 comments on commit 5fd29f2

Please sign in to comment.