Skip to content

Commit

Permalink
Merge pull request #15847 from hvitved/ruby/orm-field-as-source-no-args
Browse files Browse the repository at this point in the history
Ruby: Exclude calls with arguments from `OrmFieldAsSource`
  • Loading branch information
hvitved authored Mar 8, 2024
2 parents 7c35309 + 85782ff commit 9ee2314
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ruby/ql/lib/codeql/ruby/security/XSS.qll
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,9 @@ module StoredXss {
OrmFieldAsSource() {
exists(DataFlow::CallNode subSrc |
OrmTracking::flow(subSrc, this.getReceiver()) and
subSrc.(OrmInstantiation).methodCallMayAccessField(this.getMethodName())
subSrc.(OrmInstantiation).methodCallMayAccessField(this.getMethodName()) and
this.getNumberOfArguments() = 0 and
not exists(this.getBlock())
)
}
}
Expand Down

0 comments on commit 9ee2314

Please sign in to comment.