Skip to content

Commit b4ed773

Browse files
Add change note + fix qldoc
1 parent 3e61be1 commit b4ed773

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* Modeled instances of `ActionDispatch::Http::UploadedFile` that can be obtained from element reads of `ActionController::Parameters`, with calls to `original_filename`, `content_type`, and `read` now propagating taint from their receiver.

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ private module ParamsSummaries {
597597
/** Flow summary for various string attributes of `UploadedFile`, including `original_filename`, `content_type`, and `headers`. */
598598
private class UploadedFileStringAttributeSummary extends SummarizedCallable {
599599
UploadedFileStringAttributeSummary() {
600-
this = "ActionDispatch::Http::UploadedFile::[original_filename,content_type,headers]"
600+
this = "ActionDispatch::Http::UploadedFile#[original_filename,content_type,headers]"
601601
}
602602

603603
override MethodCall getACall() {
@@ -615,11 +615,11 @@ private module ParamsSummaries {
615615
}
616616

617617
/**
618-
* Flow summary for `ActiveDispatch::Http::UploadedFile.original_filename`,
619-
* which propagates taint from the receiver to the return value or to the second (buffer) argument
618+
* Flow summary for `ActiveDispatch::Http::UploadedFile#read`,
619+
* which propagates taint from the receiver to the return value or to the second (out string) argument
620620
*/
621621
private class UploadedFileReadSummary extends SummarizedCallable {
622-
UploadedFileReadSummary() { this = "ActionDispatch::Http::UploadedFile::read" }
622+
UploadedFileReadSummary() { this = "ActionDispatch::Http::UploadedFile#read" }
623623

624624
override MethodCall getACall() {
625625
result = paramsFieldType().getAMethodCall("read").asExpr().getExpr() and

ruby/ql/test/library-tests/dataflow/local/TaintStep.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2835,9 +2835,9 @@
28352835
| file://:0:0:0:0 | [summary param] self in ActionController::Parameters#merge | file://:0:0:0:0 | [summary] to write: ReturnValue in ActionController::Parameters#merge |
28362836
| file://:0:0:0:0 | [summary param] self in ActionController::Parameters#merge! | file://:0:0:0:0 | [summary] to write: Argument[self] in ActionController::Parameters#merge! |
28372837
| file://:0:0:0:0 | [summary param] self in ActionController::Parameters#merge! | file://:0:0:0:0 | [summary] to write: ReturnValue in ActionController::Parameters#merge! |
2838-
| file://:0:0:0:0 | [summary param] self in ActionDispatch::Http::UploadedFile::[original_filename,content_type,headers] | file://:0:0:0:0 | [summary] to write: ReturnValue in ActionDispatch::Http::UploadedFile::[original_filename,content_type,headers] |
2839-
| file://:0:0:0:0 | [summary param] self in ActionDispatch::Http::UploadedFile::read | file://:0:0:0:0 | [summary] to write: Argument[1] in ActionDispatch::Http::UploadedFile::read |
2840-
| file://:0:0:0:0 | [summary param] self in ActionDispatch::Http::UploadedFile::read | file://:0:0:0:0 | [summary] to write: ReturnValue in ActionDispatch::Http::UploadedFile::read |
2838+
| file://:0:0:0:0 | [summary param] self in ActionDispatch::Http::UploadedFile#[original_filename,content_type,headers] | file://:0:0:0:0 | [summary] to write: ReturnValue in ActionDispatch::Http::UploadedFile#[original_filename,content_type,headers] |
2839+
| file://:0:0:0:0 | [summary param] self in ActionDispatch::Http::UploadedFile#read | file://:0:0:0:0 | [summary] to write: Argument[1] in ActionDispatch::Http::UploadedFile#read |
2840+
| file://:0:0:0:0 | [summary param] self in ActionDispatch::Http::UploadedFile#read | file://:0:0:0:0 | [summary] to write: ReturnValue in ActionDispatch::Http::UploadedFile#read |
28412841
| file://:0:0:0:0 | [summary param] self in ActiveSupportStringTransform | file://:0:0:0:0 | [summary] to write: ReturnValue in ActiveSupportStringTransform |
28422842
| file://:0:0:0:0 | [summary param] self in [] | file://:0:0:0:0 | [summary] to write: ReturnValue in [] |
28432843
| file://:0:0:0:0 | [summary param] self in \| | file://:0:0:0:0 | [summary] read: Argument[self].Element[any] in \| |

0 commit comments

Comments
 (0)