UUID should not be able to cause log-injection #10722
-
I am getting a false positive for a log-injection in the following code snippet. It has been slightly simplified from the actual codebase but the important bits are the same.
In the above example |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
@github/codeql-java: A question for you. |
Beta Was this translation helpful? Give feedback.
-
Hey @Sarastro72, thanks for the report! This is indeed a false positive, but not something specific to log injection: in general, our data flow queries don't restrict sources by type at this level because there are many types that cannot realistically carry taint, but also there are many that can — so adding a type-by-type exception doesn't seem to scale very well, but doing something like "accept only String sources" obviously would introduce false negatives. Nevertheless, we agree this could be improved, so we've tracked it in an internal issue and will address it generally once we decide on a proper solution. |
Beta Was this translation helpful? Give feedback.
Hey @Sarastro72, thanks for the report!
This is indeed a false positive, but not something specific to log injection: in general, our data flow queries don't restrict sources by type at this level because there are many types that cannot realistically carry taint, but also there are many that can — so adding a type-by-type exception doesn't seem to scale very well, but doing something like "accept only String sources" obviously would introduce false negatives.
Nevertheless, we agree this could be improved, so we've tracked it in an internal issue and will address it generally once we decide on a proper solution.