Skip to content

Commit 85782ff

Browse files
committed
Ruby: Exclude calls with arguments from OrmFieldAsSource
1 parent 67612e6 commit 85782ff

File tree

1 file changed

+3
-1
lines changed
  • ruby/ql/lib/codeql/ruby/security

1 file changed

+3
-1
lines changed

ruby/ql/lib/codeql/ruby/security/XSS.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,9 @@ module StoredXss {
324324
OrmFieldAsSource() {
325325
exists(DataFlow::CallNode subSrc |
326326
OrmTracking::flow(subSrc, this.getReceiver()) and
327-
subSrc.(OrmInstantiation).methodCallMayAccessField(this.getMethodName())
327+
subSrc.(OrmInstantiation).methodCallMayAccessField(this.getMethodName()) and
328+
this.getNumberOfArguments() = 0 and
329+
not exists(this.getBlock())
328330
)
329331
}
330332
}

0 commit comments

Comments
 (0)