File tree Expand file tree Collapse file tree
ruby/ql/lib/codeql/ruby/security Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,11 +85,13 @@ module CleartextLogging {
8585 */
8686 private class MaskingReplacerSanitizedNode extends SanitizerIn {
8787 MaskingReplacerSanitizedNode ( ) {
88- exists ( MaskingReplacerSanitizer maskCall , Variable v |
89- maskCall .getMethodName ( ) = [ "sub!" , "gsub!" ] and
90- v = maskCall .getReceiver ( ) .asExpr ( ) .getExpr ( ) .( VariableReadAccess ) .getVariable ( ) and
91- v = this .asExpr ( ) .getExpr ( ) .( VariableReadAccess ) .getVariable ( ) and
92- maskCall .asExpr ( ) .getASuccessor * ( ) = this .asExpr ( )
88+ exists ( Ssa:: Definition def |
89+ exists ( MaskingReplacerSanitizer maskCall |
90+ maskCall .getMethodName ( ) = [ "sub!" , "gsub!" ] and
91+ def .hasAdjacentReads ( maskCall .getReceiver ( ) .asExpr ( ) , this .asExpr ( ) )
92+ )
93+ or
94+ def .hasAdjacentReads ( any ( MaskingReplacerSanitizedNode read ) .asExpr ( ) , this .asExpr ( ) )
9395 )
9496 }
9597 }
You can’t perform that action at this time.
0 commit comments