-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(policies): initial Rails JWT leaks (#182)
* feat: initial Rails JWT leaks * chore: update snapshot
- Loading branch information
Showing
6 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
integration/custom_detectors/.snapshots/TestCustomDetectors-detect_rails_jwt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
data_types: | ||
- name: Email Address | ||
detectors: | ||
- name: detect_rails_jwt | ||
locations: | ||
- filename: testdata/ruby/detect_rails_jwt.rb | ||
line_number: 12 | ||
- name: ruby | ||
locations: | ||
- filename: testdata/ruby/detect_rails_jwt.rb | ||
line_number: 12 | ||
- name: Physical Address | ||
detectors: | ||
- name: detect_rails_jwt | ||
locations: | ||
- filename: testdata/ruby/detect_rails_jwt.rb | ||
line_number: 10 | ||
- name: ruby | ||
locations: | ||
- filename: testdata/ruby/detect_rails_jwt.rb | ||
line_number: 10 | ||
risks: | ||
- detector_id: detect_rails_jwt | ||
data_types: | ||
- name: Email Address | ||
stored: false | ||
locations: | ||
- filename: testdata/ruby/detect_rails_jwt.rb | ||
line_number: 12 | ||
parent: | ||
line_number: 10 | ||
content: JWT.encode user.address, nil, "none" | ||
- name: Physical Address | ||
stored: false | ||
locations: | ||
- filename: testdata/ruby/detect_rails_jwt.rb | ||
line_number: 10 | ||
parent: | ||
line_number: 10 | ||
content: JWT.encode user.address, nil, "none" | ||
components: [] | ||
|
||
|
||
-- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
integration/custom_detectors/testdata/ruby/detect_rails_jwt.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
payload = { | ||
user: { | ||
first_name: "John", | ||
last_name: "Doe", | ||
} | ||
} | ||
|
||
token1 = JWT.encode payload, nil, "none" | ||
|
||
token2 = JWT.encode user.address, nil, "none" | ||
|
||
token3 = JWT.encode(user.email, nil, "none") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters