Skip to content

Commit ee6fa93

Browse files
authored
Merge pull request github#12657 from alexrford/rb/sensitive-get-no-path-problem
Ruby: convert `rb/sensitive-get-query` into a `@kind problem`
2 parents 329684c + 6f08447 commit ee6fa93

File tree

3 files changed

+12
-31
lines changed

3 files changed

+12
-31
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* `rb/sensitive-get-query` no longer reports flow paths from input parameters to sensitive use nodes. This avoids cases where many flow paths could be generated for a single parameter, which caused excessive paths to be generated.

ruby/ql/src/queries/security/cwe-598/SensitiveGetQuery.ql

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @name Sensitive data read from GET request
33
* @description Placing sensitive data in a GET request increases the risk of
44
* the data being exposed to an attacker.
5-
* @kind path-problem
5+
* @kind problem
66
* @problem.severity warning
77
* @security-severity 6.5
88
* @precision high
@@ -12,12 +12,10 @@
1212
*/
1313

1414
import ruby
15-
import DataFlow::PathGraph
1615
import codeql.ruby.security.SensitiveGetQueryQuery
1716
import codeql.ruby.security.SensitiveActions
1817

19-
from DataFlow::PathNode source, DataFlow::PathNode sink, SensitiveGetQuery::Configuration config
20-
where config.hasFlowPath(source, sink)
21-
select source.getNode(), source, sink,
22-
"$@ for GET requests uses query parameter as sensitive data.",
23-
source.getNode().(SensitiveGetQuery::Source).getHandler(), "Route handler"
18+
from DataFlow::Node source, DataFlow::Node sink, SensitiveGetQuery::Configuration config
19+
where config.hasFlow(source, sink)
20+
select source, "$@ for GET requests uses query parameter as sensitive data.",
21+
source.(SensitiveGetQuery::Source).getHandler(), "Route handler"
Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,3 @@
1-
edges
2-
| app/controllers/users_controller.rb:4:11:4:16 | call to params : | app/controllers/users_controller.rb:4:11:4:27 | ...[...] |
3-
| app/controllers/users_controller.rb:9:16:9:21 | call to params : | app/controllers/users_controller.rb:9:16:9:27 | ...[...] : |
4-
| app/controllers/users_controller.rb:9:16:9:27 | ...[...] : | app/controllers/users_controller.rb:10:42:10:49 | password |
5-
| app/controllers/users_controller.rb:14:5:14:13 | [post] self [@password] : | app/controllers/users_controller.rb:15:42:15:50 | self [@password] : |
6-
| app/controllers/users_controller.rb:14:17:14:22 | call to params : | app/controllers/users_controller.rb:14:17:14:28 | ...[...] : |
7-
| app/controllers/users_controller.rb:14:17:14:28 | ...[...] : | app/controllers/users_controller.rb:14:5:14:13 | [post] self [@password] : |
8-
| app/controllers/users_controller.rb:15:42:15:50 | self [@password] : | app/controllers/users_controller.rb:15:42:15:50 | @password |
9-
nodes
10-
| app/controllers/users_controller.rb:4:11:4:16 | call to params : | semmle.label | call to params : |
11-
| app/controllers/users_controller.rb:4:11:4:27 | ...[...] | semmle.label | ...[...] |
12-
| app/controllers/users_controller.rb:9:16:9:21 | call to params : | semmle.label | call to params : |
13-
| app/controllers/users_controller.rb:9:16:9:27 | ...[...] : | semmle.label | ...[...] : |
14-
| app/controllers/users_controller.rb:10:42:10:49 | password | semmle.label | password |
15-
| app/controllers/users_controller.rb:14:5:14:13 | [post] self [@password] : | semmle.label | [post] self [@password] : |
16-
| app/controllers/users_controller.rb:14:17:14:22 | call to params : | semmle.label | call to params : |
17-
| app/controllers/users_controller.rb:14:17:14:28 | ...[...] : | semmle.label | ...[...] : |
18-
| app/controllers/users_controller.rb:15:42:15:50 | @password | semmle.label | @password |
19-
| app/controllers/users_controller.rb:15:42:15:50 | self [@password] : | semmle.label | self [@password] : |
20-
subpaths
21-
#select
22-
| app/controllers/users_controller.rb:4:11:4:16 | call to params | app/controllers/users_controller.rb:4:11:4:16 | call to params : | app/controllers/users_controller.rb:4:11:4:27 | ...[...] | $@ for GET requests uses query parameter as sensitive data. | app/controllers/users_controller.rb:3:3:6:5 | login_get_1 | Route handler |
23-
| app/controllers/users_controller.rb:9:16:9:21 | call to params | app/controllers/users_controller.rb:9:16:9:21 | call to params : | app/controllers/users_controller.rb:10:42:10:49 | password | $@ for GET requests uses query parameter as sensitive data. | app/controllers/users_controller.rb:8:3:11:5 | login_get_2 | Route handler |
24-
| app/controllers/users_controller.rb:14:17:14:22 | call to params | app/controllers/users_controller.rb:14:17:14:22 | call to params : | app/controllers/users_controller.rb:15:42:15:50 | @password | $@ for GET requests uses query parameter as sensitive data. | app/controllers/users_controller.rb:13:3:16:5 | login_get_3 | Route handler |
1+
| app/controllers/users_controller.rb:4:11:4:16 | call to params | $@ for GET requests uses query parameter as sensitive data. | app/controllers/users_controller.rb:3:3:6:5 | login_get_1 | Route handler |
2+
| app/controllers/users_controller.rb:9:16:9:21 | call to params | $@ for GET requests uses query parameter as sensitive data. | app/controllers/users_controller.rb:8:3:11:5 | login_get_2 | Route handler |
3+
| app/controllers/users_controller.rb:14:17:14:22 | call to params | $@ for GET requests uses query parameter as sensitive data. | app/controllers/users_controller.rb:13:3:16:5 | login_get_3 | Route handler |

0 commit comments

Comments
 (0)