Skip to content

Commit 326666a

Browse files
committed
update the alert-messages of csharp queries
1 parent 0581b91 commit 326666a

File tree

91 files changed

+398
-397
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+398
-397
lines changed

csharp/ql/campaigns/Solorigate/src/ModifiedFnvFunctionDetection.ql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,5 @@ where
2727
xor2.getAnOperand() = v.getAnAccess()
2828
)
2929
)
30-
select l,
31-
"The variable $@ seems to be used as part of a FNV-like hash calculation, that is modified by an additional $@ expression using literal $@.",
32-
v, v.toString(), additional_xor, "xor", l, l.toString()
30+
select l, "This literal is used in an $@ after a FNV-like hash calculation with variable $@.",
31+
additional_xor, "additional xor", v, v.toString()

csharp/ql/campaigns/Solorigate/src/NumberOfKnownCommandsAboveThreshold.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ where
3434
total = countSolorigateCommandInEnum(e) and
3535
total > 10
3636
select e,
37-
"The enum $@ may be related to Solorigate. It matches " + total +
38-
" of the values used for commands in the enum.", e, e.getName()
37+
"The enum may be related to Solorigate. It matches " + total +
38+
" of the values used for commands in the enum."

csharp/ql/campaigns/Solorigate/src/NumberOfKnownHashesAboveThreshold.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ where
2929
isSolorigateHash(l) and
3030
total > threshold
3131
select l,
32-
"The Hash literal $@ may be related to the Solorigate campaign. Total count = " + total +
33-
" is above the threshold " + threshold + ".", l, l.getValue()
32+
"This Hash literal may be related to the Solorigate campaign. Total count = " + total +
33+
" is above the threshold " + threshold + "."

csharp/ql/campaigns/Solorigate/src/NumberOfKnownLiteralsAboveThreshold.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ where
2929
isSolorigateLiteral(l) and
3030
total > threshold
3131
select l,
32-
"The literal $@ may be related to the Solorigate campaign. Total count = " + total +
33-
" is above the threshold " + threshold + ".", l, l.getValue()
32+
"This literal may be related to the Solorigate campaign. Total count = " + total +
33+
" is above the threshold " + threshold + "."

csharp/ql/campaigns/Solorigate/src/NumberOfKnownMethodNamesAboveThreshold.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ where
2828
isSolorigateSuspiciousMethodName(m) and
2929
total > threshold
3030
select m,
31-
"The method $@ may be related to Solorigate. Total count = " + total + " is above the threshold " +
32-
threshold + ".", m, m.getName()
31+
"This method " + m.getName() + " may be related to Solorigate. Total count = " + total +
32+
" is above the threshold " + threshold + "."
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +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 |
1+
| 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 |

csharp/ql/src/API Abuse/ClassDoesNotImplementEquals.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ where
2323
exists(MethodCall callToEquals |
2424
callToEquals.getTarget() instanceof EqualsMethod and
2525
callToEquals.getQualifier().getType() = c and
26-
message = "but it is called $@" and
26+
message = "but $@" and
2727
item = callToEquals and
28-
itemText = "here"
28+
itemText = "'Equals' is called on an instance of this class"
2929
)
3030
or
3131
item = c.getAnOperator().(EQOperator) and

csharp/ql/src/API Abuse/NoDisposeCallOnLocalIDisposable.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,4 @@ predicate mayNotBeDisposed(LocalScopeDisposableCreation disposable) {
106106

107107
from LocalScopeDisposableCreation disposable
108108
where mayNotBeDisposed(disposable)
109-
select disposable, "Disposable '" + disposable.getType() + "' is created here but is not disposed."
109+
select disposable, "Disposable '" + disposable.getType() + "' is created but not disposed."

csharp/ql/src/CSI/NullAlways.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ import semmle.code.csharp.dataflow.Nullness
1616

1717
from Dereference d, Ssa::SourceVariable v
1818
where d.isFirstAlwaysNull(v)
19-
select d, "Variable $@ is always null here.", v, v.toString()
19+
select d, "Variable $@ is always null at this dereference.", v, v.toString()

csharp/ql/src/CSI/NullMaybe.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ import PathGraph
1919
from
2020
Dereference d, PathNode source, PathNode sink, Ssa::SourceVariable v, string msg, Element reason
2121
where d.isFirstMaybeNull(v.getAnSsaDefinition(), source, sink, msg, reason)
22-
select d, source, sink, "Variable $@ may be null here " + msg + ".", v, v.toString(), reason, "this"
22+
select d, source, sink, "Variable $@ may be null at this access " + msg + ".", v, v.toString(),
23+
reason, "this"

csharp/ql/src/Concurrency/SynchSetUnsynchGet.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ where
2828
readaccess.getEnclosingCallable() = getter and
2929
not exists(LockStmt readlock | readlock.getAChildStmt+().getAChildExpr+() = readaccess)
3030
)
31-
select p, "Field '$@' is guarded by a lock in the setter but not in the getter.", f, f.getName()
31+
select p, "Field $@ is guarded by a lock in the setter but not in the getter.", f, f.getName()

csharp/ql/src/Dead Code/NonAssignedFields.ql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,5 @@ where
111111
fa.getTarget() = g and
112112
g.getUnboundDeclaration() = f
113113
)
114-
select f,
115-
"The field '" + f.getName() + "' is never explicitly assigned a value, yet it is read $@.", fa,
116-
"here"
114+
select f, "The field '" + f.getName() + "' is never explicitly assigned a value, yet $@.", fa,
115+
"the field is read"

csharp/ql/src/Dead Code/UnusedField.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ where
1919
f.fromSource() and
2020
isDeadField(f) and
2121
not f.getDeclaringType().isPartial()
22-
select f, "Unused field (or field used from dead method only)"
22+
select f, "Unused field (or field used from dead method only)."

csharp/ql/src/Dead Code/UnusedMethod.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ where
2020
m.fromSource() and
2121
isDeadMethod(m) and
2222
not m.getDeclaringType().isPartial()
23-
select m, "Unused method (or method called from dead method only)"
23+
select m, "Unused method (or method called from dead method only)."

csharp/ql/src/Language Abuse/ForeachCapture.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,5 @@ predicate declaredInsideLoop(ForeachStmt loop, LocalVariable v) {
111111

112112
from LambdaDataFlowConfiguration c, AnonymousFunctionExpr lambda, Variable loopVar, Element storage
113113
where c.capturesLoopVarAndIsStoredIn(lambda, loopVar, storage)
114-
select lambda, "Function which may be stored in $@ captures variable $@", storage,
114+
select lambda, "Function which may be stored in $@ captures variable $@.", storage,
115115
storage.toString(), loopVar, loopVar.getName()

csharp/ql/src/Language Abuse/UselessIsBeforeAs.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ where
3535
uselessIsBeforeAs(ae, ie) and
3636
not exists(MethodCall mc | ae = mc.getAnArgument().getAChildExpr*())
3737
select ae,
38-
"This 'as' expression performs a type test - it should be directly compared against null, rendering the 'is' $@ potentially redundant.",
39-
ie, "here"
38+
"This 'as' expression performs a type test - it should be directly compared against null, rendering the $@ potentially redundant.",
39+
ie, "is"

csharp/ql/src/Linq/BadMultipleIteration.ql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,5 @@ where
5959
va = seq.getAnAccess() and
6060
potentiallyConsumingAccess(va) and
6161
count(VariableAccess x | x = seq.getAnAccess() and potentiallyConsumingAccess(x)) > 1
62-
select seq,
63-
"This enumerable sequence may not be repeatable, but is potentially consumed multiple times $@.",
64-
va, "here"
62+
select seq, "This enumerable sequence may not be repeatable, but $@.", va,
63+
"it is potentially consumed multiple times"

csharp/ql/src/Linq/MissedCastOpportunity.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ import Linq.Helpers
1616
from ForeachStmt fes, LocalVariableDeclStmt s
1717
where missedCastOpportunity(fes, s)
1818
select fes,
19-
"This foreach loop immediately casts its iteration variable to another type $@ - consider casting the sequence explicitly using '.Cast(...)'.",
20-
s, "here"
19+
"This foreach loop immediately $@ - consider casting the sequence explicitly using '.Cast(...)'.",
20+
s, "casts its iteration variable to another type"

csharp/ql/src/Linq/MissedOfTypeOpportunity.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ import Linq.Helpers
1616
from ForeachStmt fes, LocalVariableDeclStmt s
1717
where missedOfTypeOpportunity(fes, s)
1818
select fes,
19-
"This foreach loop immediately uses 'as' to coerce its iteration variable to another type $@ - consider using '.OfType(...)' instead.",
20-
s, "here"
19+
"This foreach loop immediately uses 'as' to $@ - consider using '.OfType(...)' instead.", s,
20+
"coerce its iteration variable to another type"

csharp/ql/src/Linq/MissedSelectOpportunity.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ where
2525
missedSelectOpportunity(fes, s) and
2626
not oversized(s)
2727
select fes,
28-
"This foreach loop immediately maps its iteration variable to another variable $@ - consider mapping the sequence explicitly using '.Select(...)'.",
29-
s, "here"
28+
"This foreach loop immediately $@ - consider mapping the sequence explicitly using '.Select(...)'.",
29+
s, "maps its iteration variable to another variable"

csharp/ql/src/Linq/MissedWhereOpportunity.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ where
1717
missedWhereOpportunity(fes, is) and
1818
not missedAllOpportunity(fes)
1919
select fes,
20-
"This foreach loop implicitly filters its target sequence $@ - consider filtering the sequence explicitly using '.Where(...)'.",
21-
is.getCondition(), "here"
20+
"This foreach loop $@ - consider filtering the sequence explicitly using '.Where(...)'.",
21+
is.getCondition(), "implicitly filters its target sequence"

csharp/ql/src/Security Features/CWE-022/TaintedPath.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ import semmle.code.csharp.dataflow.DataFlow::DataFlow::PathGraph
2020

2121
from TaintTrackingConfiguration c, DataFlow::PathNode source, DataFlow::PathNode sink
2222
where c.hasFlowPath(source, sink)
23-
select sink.getNode(), source, sink, "$@ flows to here and is used in a path.", source.getNode(),
24-
"User-provided value"
23+
select sink.getNode(), source, sink, "This path depends on a $@.", source.getNode(),
24+
"user-provided value"

csharp/ql/src/Security Features/CWE-078/CommandInjection.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ import semmle.code.csharp.dataflow.DataFlow::DataFlow::PathGraph
1919

2020
from TaintTrackingConfiguration c, DataFlow::PathNode source, DataFlow::PathNode sink
2121
where c.hasFlowPath(source, sink)
22-
select sink.getNode(), source, sink, "$@ flows to here and is used in a command.", source.getNode(),
23-
"User-provided value"
22+
select sink.getNode(), source, sink, "Command line depends on a $@.", source.getNode(),
23+
"user-provided value"

csharp/ql/src/Security Features/CWE-078/StoredCommandInjection.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ class StoredTaintTrackingConfiguration extends TaintTrackingConfiguration {
2424

2525
from StoredTaintTrackingConfiguration c, DataFlow::PathNode source, DataFlow::PathNode sink
2626
where c.hasFlowPath(source, sink)
27-
select sink.getNode(), source, sink, "$@ flows to here and is used in a command.", source.getNode(),
28-
"Stored user-provided value"
27+
select sink.getNode(), source, sink, "Command line depends on a $@.", source.getNode(),
28+
"stored user-provided value"

csharp/ql/src/Security Features/CWE-079/StoredXSS.ql

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ from
2929
where
3030
c.hasFlowPath(source, sink) and
3131
if exists(sink.getNode().(Sink).explanation())
32-
then explanation = ": " + sink.getNode().(Sink).explanation() + "."
33-
else explanation = "."
34-
select sink.getNode(), source, sink,
35-
"$@ flows to here and is written to HTML or JavaScript" + explanation, source.getNode(),
36-
"Stored user-provided value"
32+
then explanation = " (" + sink.getNode().(Sink).explanation() + ")"
33+
else explanation = ""
34+
select sink.getNode(), source, sink, "HTML or JavaScript write" + explanation + " depends on a $@.",
35+
source.getNode(), "stored user-provided value"

csharp/ql/src/Security Features/CWE-089/SecondOrderSqlInjection.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ class StoredTaintTrackingConfiguration extends SqlInjection::TaintTrackingConfig
2222

2323
from StoredTaintTrackingConfiguration c, DataFlow::PathNode source, DataFlow::PathNode sink
2424
where c.hasFlowPath(source, sink)
25-
select sink.getNode(), source, sink, "$@ flows to here and is used in an SQL query.",
26-
source.getNode(), "Stored user-provided value"
25+
select sink.getNode(), source, sink, "This SQL query depends on a $@.", source.getNode(),
26+
"stored user-provided value"

csharp/ql/src/Security Features/CWE-089/SqlInjection.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ string getSourceType(DataFlow::Node node) {
2525

2626
from TaintTrackingConfiguration c, DataFlow::PathNode source, DataFlow::PathNode sink
2727
where c.hasFlowPath(source, sink)
28-
select sink.getNode(), source, sink, "Query might include code from $@.", source,
28+
select sink.getNode(), source, sink, "This query depends on $@.", source,
2929
("this " + getSourceType(source.getNode()))

csharp/ql/src/Security Features/CWE-090/LDAPInjection.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ import semmle.code.csharp.dataflow.DataFlow::DataFlow::PathGraph
1717

1818
from TaintTrackingConfiguration c, DataFlow::PathNode source, DataFlow::PathNode sink
1919
where c.hasFlowPath(source, sink)
20-
select sink.getNode(), source, sink, "$@ flows to here and is used in an LDAP query.",
21-
source.getNode(), "User-provided value"
20+
select sink.getNode(), source, sink, "LDAP query depends on a $@.", source.getNode(),
21+
"user-provided value"

csharp/ql/src/Security Features/CWE-090/StoredLDAPInjection.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ class StoredTaintTrackingConfiguration extends TaintTrackingConfiguration {
2222

2323
from StoredTaintTrackingConfiguration c, DataFlow::PathNode source, DataFlow::PathNode sink
2424
where c.hasFlowPath(source, sink)
25-
select sink.getNode(), source, sink, "$@ flows to here and is used in an LDAP query.",
26-
source.getNode(), "Stored user-provided value"
25+
select sink.getNode(), source, sink, "This LDAP query depends on a $@.", source.getNode(),
26+
"stored user-provided value"

csharp/ql/src/Security Features/CWE-091/XMLInjection.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,5 @@ class TaintTrackingConfiguration extends TaintTracking::Configuration {
4848

4949
from TaintTrackingConfiguration c, DataFlow::PathNode source, DataFlow::PathNode sink
5050
where c.hasFlowPath(source, sink)
51-
select sink, source, sink, "$@ flows to here and is inserted as XML.", source, "User-provided value"
51+
select sink.getNode(), source, sink, "This XML element depends on a $@.", source.getNode(),
52+
"user-provided value"

csharp/ql/src/Security Features/CWE-094/CodeInjection.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ import semmle.code.csharp.dataflow.DataFlow::DataFlow::PathGraph
1919

2020
from TaintTrackingConfiguration c, DataFlow::PathNode source, DataFlow::PathNode sink
2121
where c.hasFlowPath(source, sink)
22-
select sink.getNode(), source, sink, "$@ flows to here and is compiled as code.", source.getNode(),
23-
"User-provided value"
22+
select sink.getNode(), source, sink, "This code compilation depends on a $@.", source.getNode(),
23+
"user-provided value"

csharp/ql/src/Security Features/CWE-099/ResourceInjection.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ import semmle.code.csharp.dataflow.DataFlow::DataFlow::PathGraph
1717

1818
from TaintTrackingConfiguration c, DataFlow::PathNode source, DataFlow::PathNode sink
1919
where c.hasFlowPath(source, sink)
20-
select sink.getNode(), source, sink, "$@ flows to here and is used in a resource descriptor.",
21-
source.getNode(), "User-provided value"
20+
select sink.getNode(), source, sink, "Resource descriptor depends on a $@.", source.getNode(),
21+
"user-provided value"

csharp/ql/src/Security Features/CWE-112/MissingXMLValidation.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ import semmle.code.csharp.dataflow.DataFlow::DataFlow::PathGraph
1818
from TaintTrackingConfiguration c, DataFlow::PathNode source, DataFlow::PathNode sink
1919
where c.hasFlowPath(source, sink)
2020
select sink.getNode(), source, sink,
21-
"$@ flows to here and is processed as XML without validation because " +
22-
sink.getNode().(Sink).getReason(), source.getNode(), "User-provided value"
21+
"XML processing depends on a $@ without validation because " + sink.getNode().(Sink).getReason(),
22+
source.getNode(), "user-provided value"

csharp/ql/src/Security Features/CWE-114/AssemblyPathInjection.ql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,4 @@ class TaintTrackingConfiguration extends TaintTracking::Configuration {
4949

5050
from TaintTrackingConfiguration c, DataFlow::Node source, DataFlow::Node sink
5151
where c.hasFlow(source, sink)
52-
select sink, "$@ flows to here and is used as the path to dynamically load an assembly.", source,
53-
"User-provided value"
52+
select sink, "This assembly path depends on a $@.", source, "user-provided value"

csharp/ql/src/Security Features/CWE-117/LogForging.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ import semmle.code.csharp.dataflow.DataFlow::DataFlow::PathGraph
1717

1818
from TaintTrackingConfiguration c, DataFlow::PathNode source, DataFlow::PathNode sink
1919
where c.hasFlowPath(source, sink)
20-
select sink.getNode(), source, sink, "$@ flows to log entry.", source.getNode(),
21-
"User-provided value"
20+
select sink.getNode(), source, sink, "Log entry depends on a $@.", source.getNode(),
21+
"user-provided value"

csharp/ql/src/Security Features/CWE-134/UncontrolledFormatString.ql

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@ class FormatStringConfiguration extends TaintTracking::Configuration {
3131
}
3232
}
3333

34+
string getSourceType(DataFlow::Node node) {
35+
result = node.(RemoteFlowSource).getSourceType()
36+
or
37+
result = node.(LocalFlowSource).getSourceType()
38+
}
39+
3440
from FormatStringConfiguration config, DataFlow::PathNode source, DataFlow::PathNode sink
3541
where config.hasFlowPath(source, sink)
36-
select sink.getNode(), source, sink, "$@ flows to here and is used as a format string.",
37-
source.getNode(), source.getNode().toString()
42+
select sink.getNode(), source, sink, "Format string depends on a $@.", source.getNode(),
43+
("this" + getSourceType(source.getNode()))

csharp/ql/src/Security Features/CWE-201/ExposureInTransmittedData.ql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,5 @@ class TaintTrackingConfiguration extends TaintTracking::Configuration {
4747

4848
from TaintTrackingConfiguration configuration, DataFlow::PathNode source, DataFlow::PathNode sink
4949
where configuration.hasFlowPath(source, sink)
50-
select sink.getNode(), source, sink,
51-
"Sensitive information from $@ flows to here, and is transmitted to the user.", source.getNode(),
52-
source.toString()
50+
select sink.getNode(), source, sink, "Data transmitted to the user depends on $@.",
51+
source.getNode(), "sensitive information"

csharp/ql/src/Security Features/CWE-209/ExceptionInformationExposure.ql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,5 @@ class TaintTrackingConfiguration extends TaintTracking::Configuration {
6464

6565
from TaintTrackingConfiguration c, DataFlow::PathNode source, DataFlow::PathNode sink
6666
where c.hasFlowPath(source, sink)
67-
select sink.getNode(), source, sink,
68-
"Exception information from $@ flows to here, and is exposed to the user.", source.getNode(),
69-
source.toString()
67+
select sink.getNode(), source, sink, "Information exposed to the user depends on $@.",
68+
source.getNode(), "exception information"

csharp/ql/src/Security Features/CWE-312/CleartextStorage.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ import semmle.code.csharp.dataflow.DataFlow::DataFlow::PathGraph
1919

2020
from TaintTrackingConfiguration c, DataFlow::PathNode source, DataFlow::PathNode sink
2121
where c.hasFlowPath(source, sink)
22-
select sink.getNode(), source, sink, "Sensitive data returned by $@ is stored here.",
22+
select sink.getNode(), source, sink, "This stores sensitive data returned by $@ as clear text.",
2323
source.getNode(), source.toString()

csharp/ql/src/Security Features/CWE-321/HardcodedEncryptionKey.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ class StringLiteralSource extends KeySource {
3838

3939
from SymmetricKeyTaintTrackingConfiguration keyFlow, KeySource src, SymmetricEncryptionKeySink sink
4040
where keyFlow.hasFlow(src, sink)
41-
select sink, "Hard-coded symmetric $@ is used in symmetric algorithm in " + sink.getDescription(),
42-
src, "key"
41+
select sink, "Hard-coded $@ is used in symmetric algorithm in " + sink.getDescription(), src,
42+
"symmetric key"

csharp/ql/src/Security Features/CWE-327/DontInstallRootCert.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ class AddCertToRootStoreConfig extends DataFlow::Configuration {
4141

4242
from DataFlow::PathNode oc, DataFlow::PathNode mc, AddCertToRootStoreConfig config
4343
where config.hasFlowPath(oc, mc)
44-
select mc.getNode(), oc, mc, "Certificate added to the root certificate store."
44+
select mc.getNode(), oc, mc, "Certificate is added to the root certificate store."

csharp/ql/src/Security Features/CWE-327/InsecureSQLConnection.ql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@ class TaintTrackingConfiguration extends DataFlow::Configuration {
4141

4242
from TaintTrackingConfiguration c, DataFlow::PathNode source, DataFlow::PathNode sink
4343
where c.hasFlowPath(source, sink)
44-
select sink.getNode(), source, sink, "$@ flows to here and does not specify `Encrypt=True`.",
45-
source.getNode(), "Connection string"
44+
select sink.getNode(), source, sink,
45+
"$@ flows to this SQL connection and does not specify `Encrypt=True`.", source.getNode(),
46+
"Connection string"

csharp/ql/src/Security Features/CWE-384/AbandonSession.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,5 @@ where
6969
loginMethod(loginMethod, fromLoginFlow) and
7070
sessionUse(sessionUse.getElement()) and
7171
controlStep+(loginCall.getASuccessorByType(fromLoginFlow), sessionUse)
72-
select sessionUse, "This session has not been invalidated following the call to '$@'.", loginCall,
72+
select sessionUse, "This session has not been invalidated following the call to $@.", loginCall,
7373
loginMethod.getName()

csharp/ql/src/Security Features/CWE-611/UntrustedDataInsecureXml.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ import semmle.code.csharp.dataflow.DataFlow::DataFlow::PathGraph
1919
from TaintTrackingConfiguration c, DataFlow::PathNode source, DataFlow::PathNode sink
2020
where c.hasFlowPath(source, sink)
2121
select sink.getNode(), source, sink,
22-
"$@ flows to here and is loaded insecurely as XML (" + sink.getNode().(Sink).getReason() + ").",
23-
source.getNode(), "User-provided value"
22+
"Insecure XML processing depends on a $@ (" + sink.getNode().(Sink).getReason() + ").",
23+
source.getNode(), "user-provided value"

csharp/ql/src/Security Features/CWE-643/StoredXPathInjection.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ class StoredTaintTrackingConfiguration extends XPathInjection::TaintTrackingConf
2222

2323
from StoredTaintTrackingConfiguration c, DataFlow::PathNode source, DataFlow::PathNode sink
2424
where c.hasFlowPath(source, sink)
25-
select sink.getNode(), source, sink, "$@ flows to here and is used in an XPath expression.",
26-
source.getNode(), "Stored user-provided value"
25+
select sink.getNode(), source, sink, "XPath expression depends on a $@.", source.getNode(),
26+
"stored user-provided value"

csharp/ql/src/Security Features/CWE-643/XPathInjection.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ import semmle.code.csharp.dataflow.DataFlow::DataFlow::PathGraph
1717

1818
from TaintTrackingConfiguration c, DataFlow::PathNode source, DataFlow::PathNode sink
1919
where c.hasFlowPath(source, sink)
20-
select sink.getNode(), source, sink, "$@ flows to here and is used in an XPath expression.",
21-
source.getNode(), "User-provided value"
20+
select sink.getNode(), source, sink, "XPath expression depends on a $@.", source.getNode(),
21+
"user-provided value"

csharp/ql/src/Security Features/CWE-730/ReDoS.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ where
2929
sink.getNode() instanceof ExponentialRegexSink
3030
)
3131
select sink.getNode(), source, sink,
32-
"$@ flows to regular expression operation with dangerous regex.", source.getNode(),
33-
"User-provided value"
32+
"This regex operation with dangerous complexity depends on a $@.", source.getNode(),
33+
"user-provided value"

0 commit comments

Comments
 (0)