@@ -8,6 +8,7 @@ private import ruby
8
8
private import codeql.ruby.Concepts
9
9
private import codeql.ruby.security.SensitiveActions
10
10
private import codeql.ruby.dataflow.BarrierGuards
11
+ private import codeql.ruby.dataflow.SSA
11
12
12
13
private module SensitiveDataSources {
13
14
/**
@@ -42,28 +43,24 @@ private module SensitiveDataSources {
42
43
/**
43
44
* A call to a method that may return sensitive data.
44
45
*/
45
- class SensitiveMethodCall extends SensitiveDataSource:: Range , DataFlow:: CallNode instanceof SensitiveNode
46
- {
47
- SensitiveDataMethodName methodName ;
48
-
49
- SensitiveMethodCall ( ) { methodName = this .getMethodName ( ) }
50
-
46
+ class SensitiveMethodCall extends SensitiveDataSource:: Range instanceof SensitiveCall {
51
47
override SensitiveDataClassification getClassification ( ) {
52
- result = methodName .getClassification ( )
48
+ result = SensitiveCall . super .getClassification ( )
53
49
}
54
50
}
55
51
56
52
/**
57
53
* An assignment to a variable that may contain sensitive data.
58
54
*/
59
- class SensitiveVariableAssignment extends SensitiveDataSource:: Range instanceof SensitiveNode {
55
+ class SensitiveVariableAssignment extends SensitiveDataSource:: Range , DataFlow:: SsaDefinitionNode {
56
+ SensitiveNode sensitiveNode ;
57
+
60
58
SensitiveVariableAssignment ( ) {
61
- this .( DataFlow:: VariableAccessNode ) .asVariableAccessAstNode ( ) instanceof
62
- Ast:: VariableWriteAccess
59
+ this .getDefinition ( ) .( Ssa:: WriteDefinition ) .getWriteAccess ( ) = sensitiveNode .asExpr ( )
63
60
}
64
61
65
62
override SensitiveDataClassification getClassification ( ) {
66
- result = SensitiveNode . super .getClassification ( )
63
+ result = sensitiveNode .getClassification ( )
67
64
}
68
65
}
69
66
0 commit comments