Open bpmarinho opened 3 months ago
Thank you for this false positive report. Resolving this issue is not a current product priority, but we acknowledge the report and will track it internally for future consideration, or if we observe repeated instances of the same problem.
Your right that this is a false positive. The query is simply looking for SQL strings built by string concatenation without proper escaping of variables, which is usually a bad thing to do. In your case the two type
values in the enum are string constants that do not contain any special SQL characters, so it is indeed safe. You can dismiss the alert, or apply some SQL string escaping to CommentType.REVIEW_SIMPLE_COMMENT.getType()
before appending.
False positive on
Query built by concatenation with a possibly-untrusted string
-java/concatenated-sql-query
We have a constant value from enum
Used in query
And CodeQL is stating
Query built by concatenation with a possibly-untrusted string
inCommentType.REVIEW_SIMPLE_COMMENT.getType()
. From my understanding the enum is immutable. Could you take a look?