-
Notifications
You must be signed in to change notification settings - Fork 1.7k
C#: Update the alert messages to better follow the style guide #10557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
326666a
3129f0f
77eeabe
7098e7b
318718c
e2fe63f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
| test.cs:39:16:39:36 | 6605813339339102567 | The variable $@ seems to be used as part of a FNV-like hash calculation, that is modified by an additional $@ expression using literal $@. | test.cs:25:9:25:11 | num | num | test.cs:39:10:39:36 | ... ^ ... | xor | test.cs:39:16:39:36 | 6605813339339102567 | 6605813339339102567 | | ||
| test.cs:39:16:39:36 | 6605813339339102567 | This literal is used in an $@ after a FNV-like hash calculation with variable $@. | test.cs:39:10:39:36 | ... ^ ... | additional xor | test.cs:25:9:25:11 | num | num | |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,5 +20,5 @@ import semmle.code.csharp.dataflow.DataFlow::DataFlow::PathGraph | |
|
||
from TaintTrackingConfiguration c, DataFlow::PathNode source, DataFlow::PathNode sink | ||
where c.hasFlowPath(source, sink) | ||
select sink.getNode(), source, sink, "$@ flows to here and is used in a path.", source.getNode(), | ||
"User-provided value" | ||
select sink.getNode(), source, sink, "This path depends on a $@.", source.getNode(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here the message starts with "this", while it doesn't for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same for other queries; some start with "this" while others don't. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've gone for starting with "This " in most of the queries. |
||
"user-provided value" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,13 @@ class FormatStringConfiguration extends TaintTracking::Configuration { | |
} | ||
} | ||
|
||
string getSourceType(DataFlow::Node node) { | ||
result = node.(RemoteFlowSource).getSourceType() | ||
or | ||
result = node.(LocalFlowSource).getSourceType() | ||
} | ||
|
||
from FormatStringConfiguration config, DataFlow::PathNode source, DataFlow::PathNode sink | ||
where config.hasFlowPath(source, sink) | ||
select sink.getNode(), source, sink, "$@ flows to here and is used as a format string.", | ||
source.getNode(), source.getNode().toString() | ||
select sink.getNode(), source, sink, "This format string depends on $@.", source.getNode(), | ||
("this" + getSourceType(source.getNode())) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks wrong? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, there is an |
Check warning
Code scanning / CodeQL
Consistent alert message