Skip to content

Commit 5333c75

Browse files
Model additional string attributes
1 parent 8c31b61 commit 5333c75

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

ruby/ql/lib/codeql/ruby/frameworks/ActionController.qll

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -594,14 +594,18 @@ private module ParamsSummaries {
594594

595595
/** Flow summaries for `ActiveDispatch::Http::UploadedFile`, which can be an field of `ActionController::Parameters`. */
596596
module UploadedFileSummaries {
597-
/** Flow summary for `ActiveDispatch::Http::UploadedFile.original_filename` */
598-
private class UploadedFileOriginalFilenameSummary extends SummarizedCallable {
599-
UploadedFileOriginalFilenameSummary() {
600-
this = "ActionDispatch::Http::UploadedFile::original_filename"
597+
/** Flow summary for various string attributes of `UploadedFile`, including `original_filename`, `content_type`, and `headers`. */
598+
private class UploadedFileStringAttributeSummary extends SummarizedCallable {
599+
UploadedFileStringAttributeSummary() {
600+
this = "ActionDispatch::Http::UploadedFile::[original_filename,content_type,headers]"
601601
}
602602

603603
override MethodCall getACall() {
604-
result = paramsFieldType().getAMethodCall("original_filename").asExpr().getExpr() and
604+
result =
605+
paramsFieldType()
606+
.getAMethodCall(["original_filename", "content_type", "headers"])
607+
.asExpr()
608+
.getExpr() and
605609
result.getNumberOfArguments() = 0
606610
}
607611

0 commit comments

Comments
 (0)