@@ -8,6 +8,7 @@ private import ruby
88private import codeql.ruby.Concepts
99private import codeql.ruby.security.SensitiveActions
1010private import codeql.ruby.dataflow.BarrierGuards
11+ private import codeql.ruby.dataflow.SSA
1112
1213private module SensitiveDataSources {
1314 /**
@@ -42,28 +43,24 @@ private module SensitiveDataSources {
4243 /**
4344 * A call to a method that may return sensitive data.
4445 */
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 {
5147 override SensitiveDataClassification getClassification ( ) {
52- result = methodName .getClassification ( )
48+ result = SensitiveCall . super .getClassification ( )
5349 }
5450 }
5551
5652 /**
5753 * An assignment to a variable that may contain sensitive data.
5854 */
59- class SensitiveVariableAssignment extends SensitiveDataSource:: Range instanceof SensitiveNode {
55+ class SensitiveVariableAssignment extends SensitiveDataSource:: Range , DataFlow:: SsaDefinitionNode {
56+ SensitiveNode sensitiveNode ;
57+
6058 SensitiveVariableAssignment ( ) {
61- this .( DataFlow:: VariableAccessNode ) .asVariableAccessAstNode ( ) instanceof
62- Ast:: VariableWriteAccess
59+ this .getDefinition ( ) .( Ssa:: WriteDefinition ) .getWriteAccess ( ) = sensitiveNode .asExpr ( )
6360 }
6461
6562 override SensitiveDataClassification getClassification ( ) {
66- result = SensitiveNode . super .getClassification ( )
63+ result = sensitiveNode .getClassification ( )
6764 }
6865 }
6966
0 commit comments