Skip to content

Commit 9ee2314

Browse files
authored
Merge pull request #15847 from hvitved/ruby/orm-field-as-source-no-args
Ruby: Exclude calls with arguments from `OrmFieldAsSource`
2 parents 7c35309 + 85782ff commit 9ee2314

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)