Skip to content

Commit 6fdfd40

Browse files
committed
changes to address reviews
1 parent 10a014f commit 6fdfd40

File tree

22 files changed

+69
-65
lines changed

22 files changed

+69
-65
lines changed

python/ql/src/Security/CWE-020/IncompleteUrlSubstringSanitization.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,5 @@ predicate unsafe_call_to_endswith(Call sanitizer, StrConst url) {
5151

5252
from Expr sanitizer, StrConst url
5353
where incomplete_sanitization(sanitizer, url)
54-
select sanitizer, "$@ may be at an arbitrary position in the sanitized URL.", url, url.getText()
54+
select sanitizer, "The string $@ may be at an arbitrary position in the sanitized URL.", url,
55+
url.getText()

python/ql/src/Security/CWE-209/StackTraceExposure.ql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ import DataFlow::PathGraph
1919

2020
from Configuration config, DataFlow::PathNode source, DataFlow::PathNode sink
2121
where config.hasFlowPath(source, sink)
22-
select sink.getNode(), source, sink, "This information exposed to the user depends on $@.",
23-
source.getNode(), "stack trace information"
22+
select sink.getNode(), source, sink,
23+
"$@ flows to this location and may be exposed to an external user.", source.getNode(),
24+
"stack trace information"

python/ql/src/Security/CWE-295/RequestWithoutValidation.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ where
2424
// value from.
2525
if disablingNode = origin then ending = "." else ending = " by $@."
2626
select request, "This request may run without certificate validation because $@" + ending,
27-
disablingNode, "the request is disabled", origin, "this value"
27+
disablingNode, "it is disabled", origin, "this value"

python/ql/src/Security/CWE-312/CleartextLogging.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ from Configuration config, DataFlow::PathNode source, DataFlow::PathNode sink, s
2222
where
2323
config.hasFlowPath(source, sink) and
2424
classification = source.getNode().(Source).getClassification()
25-
select sink.getNode(), source, sink, "This logs sensitive data returned by $@ as clear text.",
26-
source.getNode(), "Sensitive data (" + classification + ")"
25+
select sink.getNode(), source, sink, "This expression logs $@ as clear text.", source.getNode(),
26+
"sensitive data (" + classification + ")"

python/ql/src/Security/CWE-312/CleartextStorage.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ from Configuration config, DataFlow::PathNode source, DataFlow::PathNode sink, s
2222
where
2323
config.hasFlowPath(source, sink) and
2424
classification = source.getNode().(Source).getClassification()
25-
select sink.getNode(), source, sink, "This stores $@ as clear text.", source.getNode(),
26-
"Sensitive data (" + classification + ")"
25+
select sink.getNode(), source, sink, "This expression stores $@ as clear text.", source.getNode(),
26+
"sensitive data (" + classification + ")"

python/ql/src/Security/CWE-730/RegexInjection.ql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ from
2424
where
2525
config.hasFlowPath(source, sink) and
2626
regexExecution = sink.getNode().(Sink).getRegexExecution()
27-
select sink.getNode(), source, sink, "This regular expression depends on a $@ and executed by $@.",
28-
source.getNode(), "user-provided value", regexExecution, regexExecution.getName()
27+
select sink.getNode(), source, sink,
28+
"This regular expression depends on a $@ and is executed by $@.", source.getNode(),
29+
"user-provided value", regexExecution, regexExecution.getName()

python/ql/src/Security/CWE-798/HardcodedCredentials.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,5 +129,5 @@ from HardcodedCredentialsConfiguration config, TaintedPathSource src, TaintedPat
129129
where
130130
config.hasFlowPath(src, sink) and
131131
not any(TestScope test).contains(src.getAstNode())
132-
select sink.getSink(), src, sink, "This hardcoded value is $@.", sink.getNode(),
132+
select src.getSource(), src, sink, "This hardcoded value is $@.", sink.getNode(),
133133
"used as credentials"

python/ql/src/Statements/NonIteratorInForLoop.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ where
2222
not t.failedInference(_) and
2323
not v = Value::named("None") and
2424
not t.isDescriptorType()
25-
select loop, "$@ of class $@ may be used in for-loop.", origin, "Non-iterable", t, t.getName()
25+
select loop, "This for-loop may attempt to iterate over a $@ of class $@.", origin,
26+
"non-iterable instance", t, t.getName()

python/ql/src/Variables/MultiplyDefined.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,5 @@ where
6767
forall(Name el | el = asgn1.getParentNode().(Tuple).getAnElt() | multiply_defined(el, _, _)) and
6868
not uninteresting_definition(asgn1)
6969
select asgn1,
70-
"This assignment to '" + v.getId() + "' is unnecessary as $@ before this value is used.", asgn2,
71-
"it is redefined"
70+
"This assignment to '" + v.getId() + "' is unnecessary as it is $@ before this value is used.",
71+
asgn2, "redefined"

python/ql/src/experimental/Security/CWE-022/ZipSlip.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ import DataFlow::PathGraph
1919
from ZipSlipConfig config, DataFlow::PathNode source, DataFlow::PathNode sink
2020
where config.hasFlowPath(source, sink)
2121
select source.getNode(), source, sink,
22-
"Unsanitized archive entry, which may contain '..', is used in a $@.", sink.getNode(),
22+
"This unsanitized archive entry, which may contain '..', is used in a $@.", sink.getNode(),
2323
"file system operation"

0 commit comments

Comments
 (0)