Skip to content

Commit da4376c

Browse files
committed
update alert-messsages of java queries
1 parent a8197b2 commit da4376c

File tree

135 files changed

+1585
-1579
lines changed

Some content is hidden

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

135 files changed

+1585
-1579
lines changed

java/ql/src/Frameworks/Spring/Architecture/Refactoring Opportunities/MissingParentBean.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ where
3434
bean1.getBeanIdentifier() < bean2.getBeanIdentifier() and
3535
bean1 != bean2
3636
select bean1,
37-
"Bean $@ has " + similarProps.toString() +
37+
"This bean has " + similarProps.toString() +
3838
" properties similar to $@. Consider introducing a common parent bean for these two beans.",
39-
bean1, bean1.getBeanIdentifier(), bean2, bean2.getBeanIdentifier()
39+
bean2, bean2.getBeanIdentifier()

java/ql/src/Frameworks/Spring/Violations of Best Practice/ParentShouldNotUseAbstractClass.ql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,4 @@ class ParentBean extends SpringBean {
2626

2727
from ParentBean parent
2828
where parent.getDeclaredClass().isAbstract()
29-
select parent, "Parent bean $@ should not have an abstract class.", parent,
30-
parent.getBeanIdentifier()
29+
select parent, "This parent bean should not have an abstract class."

java/ql/src/Language Abuse/UselessNullCheck.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ where
2121
e = clearlyNotNullExpr(reason) and
2222
(
2323
if reason instanceof Guard
24-
then msg = "This check is useless, $@ cannot be null here, since it is guarded by $@."
24+
then msg = "This check is useless. $@ cannot be null at this check, since it is guarded by $@."
2525
else
2626
if reason != e
27-
then msg = "This check is useless, $@ cannot be null here, since $@ always is non-null."
27+
then msg = "This check is useless. $@ cannot be null at this check, since $@ always is non-null."
2828
else msg = "This check is useless, since $@ always is non-null."
2929
)
3030
select guard, msg, e, e.toString(), reason, reason.toString()

java/ql/src/Likely Bugs/Collections/IteratorRemoveMayFail.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,5 @@ where
7272
remove.getCallee().hasName("remove") and
7373
iterOfSpecialCollection(remove.getQualifier(), scc)
7474
select remove,
75-
"This call may fail when iterating over the collection created $@, since it does not support element removal.",
76-
scc, "here"
75+
"This call may fail when iterating over $@, since it does not support element removal.", scc,
76+
"the collection"

java/ql/src/Likely Bugs/Comparison/MissingInstanceofInEquals.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,4 @@ where
7777
// Exclude `equals` methods that implement reference-equality.
7878
not m instanceof ReferenceEquals and
7979
not m instanceof UnimplementedEquals
80-
select m, "equals() method does not check argument type."
80+
select m, "This 'equals()' method does not check argument type."

java/ql/src/Likely Bugs/Comparison/WrongNanComparison.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ where
2121
eq.getAnOperand() = f.getAnAccess() and nanField(f) and f.getDeclaringType().hasName(classname)
2222
select eq,
2323
"This comparison will always yield the same result since 'NaN != NaN'. Consider using " +
24-
classname + ".isNaN instead"
24+
classname + ".isNaN instead."

java/ql/src/Likely Bugs/Concurrency/SleepWithLock.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ where
2323
ma.getEnclosingStmt().getEnclosingStmt*() instanceof SynchronizedStmt or
2424
ma.getEnclosingCallable().isSynchronized()
2525
)
26-
select ma, "sleep() with lock held."
26+
select ma, "This calls 'Thread.sleep()' with a lock held."

java/ql/src/Likely Bugs/Concurrency/WaitWithTwoLocks.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ where
2727
ma.getMethod().getDeclaringType().hasQualifiedName("java.lang", "Object") and
2828
ma.getEnclosingStmt().getEnclosingStmt*() = synch and
2929
synch.getEnclosingStmt+() instanceof Synched
30-
select ma, "wait() with two locks held."
30+
select ma, "This calls 'Object.wait()' with two locks held."

java/ql/src/Likely Bugs/Likely Typos/ContradictoryTypeChecks.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ predicate contradictoryTypeCheck(Expr e, Variable v, RefType t, RefType sup, Exp
4646

4747
from Expr e, Variable v, RefType t, RefType sup, Expr cond
4848
where contradictoryTypeCheck(e, v, t, sup, cond)
49-
select e, "Variable $@ cannot be of type $@ here, since $@ ensures that it is not of type $@.", v,
49+
select e, "This access of $@ cannot be of type $@, since $@ ensures that it is not of type $@.", v,
5050
v.getName(), t, t.getName(), cond, "this expression", sup, sup.getName()

java/ql/src/Likely Bugs/Likely Typos/SelfAssignment.ql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,4 @@ predicate sameVariable(VarAccess left, VarAccess right) {
4545
from AssignExpr assign
4646
where sameVariable(assign.getDest(), assign.getSource())
4747
select assign,
48-
"This assigns the variable " + assign.getDest().(VarAccess).getVariable().getName() +
49-
" to itself and has no effect."
48+
"This expression assigns " + assign.getDest().(VarAccess).getVariable().getName() + " to itself."

java/ql/src/Likely Bugs/Nullness/NullAlways.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ private import semmle.code.java.dataflow.Nullness
1717

1818
from VarAccess access, SsaSourceVariable var
1919
where alwaysNullDeref(var, access)
20-
select access, "Variable $@ is always null here.", var.getVariable(), var.getVariable().getName()
20+
select access, "Variable $@ is always null at this access.", var.getVariable(),
21+
var.getVariable().getName()

java/ql/src/Likely Bugs/Nullness/NullMaybe.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ where
2424
not alwaysNullDeref(var, access) and
2525
// Kotlin enforces this already:
2626
not access.getLocation().getFile().isKotlinSourceFile()
27-
select access, "Variable $@ may be null here " + msg + ".", var.getVariable(),
27+
select access, "Variable $@ may be null at this access " + msg + ".", var.getVariable(),
2828
var.getVariable().getName(), reason, "this"

java/ql/src/Likely Bugs/Serialization/IncorrectSerialVersionUID.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ where
2222
not f.getType().hasName("long")
2323
) and
2424
f.getDeclaringType().getAStrictAncestor() instanceof TypeSerializable
25-
select f, "serialVersionUID should be final, static, and of type long."
25+
select f, "'serialVersionUID' should be final, static, and of type long."

java/ql/src/Performance/InefficientOutputStream.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ where
3636
// This is the case is some dummy implementations.
3737
exists(MethodAccess ma | ma.getEnclosingCallable() = m | ma.getMethod().getName() = "write")
3838
select c,
39-
"This class extends java.io.OutputStream and implements $@, but does not override write(byte[],int,int)",
39+
"This class extends 'java.io.OutputStream' and implements $@, but does not override 'write(byte[],int,int)'.",
4040
m, m.getName()

java/ql/src/Security/CWE/CWE-022/TaintedPath.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,5 @@ DataFlow::Node getReportingNode(DataFlow::Node sink) {
7070

7171
from DataFlow::PathNode source, DataFlow::PathNode sink, TaintedPathConfig conf
7272
where conf.hasFlowPath(source, sink)
73-
select getReportingNode(sink.getNode()), source, sink, "$@ flows to here and is used in a path.",
74-
source.getNode(), "User-provided value"
73+
select getReportingNode(sink.getNode()), source, sink, "This path depends on a $@.",
74+
source.getNode(), "user-provided value"

java/ql/src/Security/CWE/CWE-022/TaintedPathLocal.ql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,4 @@ where
4141
e = p.getAnInput() and
4242
conf.hasFlowPath(source, sink) and
4343
not guarded(e)
44-
select p, source, sink, "$@ flows to here and is used in a path.", source.getNode(),
45-
"User-provided value"
44+
select p, source, sink, "This path depends on a $@.", source.getNode(), "user-provided value"

java/ql/src/Security/CWE/CWE-023/PartialPathTraversal.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
import semmle.code.java.security.PartialPathTraversal
1414

1515
from PartialPathTraversalMethodAccess ma
16-
select ma, "Partial Path Traversal Vulnerability due to insufficient guard against path traversal"
16+
select ma, "Partial Path Traversal Vulnerability due to insufficient guard against path traversal."

java/ql/src/Security/CWE/CWE-023/PartialPathTraversalFromRemote.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ import DataFlow::PathGraph
1616
from DataFlow::PathNode source, DataFlow::PathNode sink
1717
where any(PartialPathTraversalFromRemoteConfig config).hasFlowPath(source, sink)
1818
select sink.getNode(), source, sink,
19-
"Partial Path Traversal Vulnerability due to insufficient guard against path traversal from user-supplied data"
19+
"Partial Path Traversal Vulnerability due to insufficient guard against path traversal from $@.",
20+
source, "user-supplied data"

java/ql/src/Security/CWE/CWE-078/ExecTainted.ql

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

2121
from DataFlow::PathNode source, DataFlow::PathNode sink, ArgumentToExec execArg
2222
where execTainted(source, sink, execArg)
23-
select execArg, source, sink, "$@ flows to here and is used in a command.", source.getNode(),
24-
"User-provided value"
23+
select execArg, source, sink, "Command line depends on a $@.", source.getNode(),
24+
"user-provided value"

java/ql/src/Security/CWE/CWE-078/ExecTaintedLocal.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ from
3838
DataFlow::PathNode source, DataFlow::PathNode sink, ArgumentToExec execArg,
3939
LocalUserInputToArgumentToExecFlowConfig conf
4040
where conf.hasFlowPath(source, sink) and sink.getNode().asExpr() = execArg
41-
select execArg, source, sink, "$@ flows to here and is used in a command.", source.getNode(),
42-
"User-provided value"
41+
select execArg, source, sink, "Command line depends on a $@.", source.getNode(),
42+
"user-provided value"

java/ql/src/Security/CWE/CWE-079/XSS.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ class XssConfig extends TaintTracking::Configuration {
3434

3535
from DataFlow::PathNode source, DataFlow::PathNode sink, XssConfig conf
3636
where conf.hasFlowPath(source, sink)
37-
select sink.getNode(), source, sink, "Cross-site scripting vulnerability due to $@.",
37+
select sink.getNode(), source, sink, "Cross-site scripting vulnerability due to a $@.",
3838
source.getNode(), "user-provided value"

java/ql/src/Security/CWE/CWE-089/SqlTainted.ql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@ import DataFlow::PathGraph
1919

2020
from QueryInjectionSink query, DataFlow::PathNode source, DataFlow::PathNode sink
2121
where queryTaintedBy(query, source, sink)
22-
select query, source, sink, "This SQL query depends on $@.", source.getNode(),
23-
"a user-provided value"
22+
select query, source, sink, "This query depends on a $@.", source.getNode(), "user-provided value"

java/ql/src/Security/CWE/CWE-089/SqlTaintedLocal.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ class LocalUserInputToQueryInjectionFlowConfig extends TaintTracking::Configurat
3636
from
3737
DataFlow::PathNode source, DataFlow::PathNode sink, LocalUserInputToQueryInjectionFlowConfig conf
3838
where conf.hasFlowPath(source, sink)
39-
select sink.getNode(), source, sink, "Query might include code from $@.", source.getNode(),
40-
"this user input"
39+
select sink.getNode(), source, sink, "This query depends on a $@.", source.getNode(),
40+
"user-provided value"

java/ql/src/Security/CWE/CWE-090/LdapInjection.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ import DataFlow::PathGraph
1818

1919
from DataFlow::PathNode source, DataFlow::PathNode sink, LdapInjectionFlowConfig conf
2020
where conf.hasFlowPath(source, sink)
21-
select sink.getNode(), source, sink, "LDAP query might include code from $@.", source.getNode(),
22-
"this user input"
21+
select sink.getNode(), source, sink, "LDAP query depends on a $@.", source.getNode(),
22+
"user-provided value"

java/ql/src/Security/CWE/CWE-094/GroovyInjection.ql

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

1818
from DataFlow::PathNode source, DataFlow::PathNode sink, GroovyInjectionConfig conf
1919
where conf.hasFlowPath(source, sink)
20-
select sink.getNode(), source, sink, "Groovy Injection from $@.", source.getNode(),
21-
"this user input"
20+
select sink.getNode(), source, sink, "Groovy script depends on a $@.", source.getNode(),
21+
"user-provided value"

java/ql/src/Security/CWE/CWE-094/InsecureBeanValidation.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,5 @@ where
8080
exists(SetMessageInterpolatorCall c | not c.isSafe())
8181
) and
8282
cfg.hasFlowPath(source, sink)
83-
select sink.getNode(), source, sink,
84-
"Custom constraint error message contains unsanitized user data"
83+
select sink.getNode(), source, sink, "Custom constraint error message contains an unsanitized $@.",
84+
source, "user-provided value"

java/ql/src/Security/CWE/CWE-094/JexlInjection.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ import DataFlow::PathGraph
1717

1818
from DataFlow::PathNode source, DataFlow::PathNode sink, JexlInjectionConfig conf
1919
where conf.hasFlowPath(source, sink)
20-
select sink.getNode(), source, sink, "JEXL injection from $@.", source.getNode(), "this user input"
20+
select sink.getNode(), source, sink, "JEXL expression depends on a $@.", source.getNode(),
21+
"user-provided value"

java/ql/src/Security/CWE/CWE-094/MvelInjection.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ import DataFlow::PathGraph
1717

1818
from DataFlow::PathNode source, DataFlow::PathNode sink, MvelInjectionFlowConfig conf
1919
where conf.hasFlowPath(source, sink)
20-
select sink.getNode(), source, sink, "MVEL injection from $@.", source.getNode(), "this user input"
20+
select sink.getNode(), source, sink, "MVEL expression depends on a $@.", source.getNode(),
21+
"user-provided value"

java/ql/src/Security/CWE/CWE-094/SpelInjection.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ import DataFlow::PathGraph
1818

1919
from DataFlow::PathNode source, DataFlow::PathNode sink, SpelInjectionConfig conf
2020
where conf.hasFlowPath(source, sink)
21-
select sink.getNode(), source, sink, "SpEL injection from $@.", source.getNode(), "this user input"
21+
select sink.getNode(), source, sink, "SpEL expression depends on a $@.", source.getNode(),
22+
"user-provided value"

java/ql/src/Security/CWE/CWE-094/TemplateInjection.ql

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

1818
from TemplateInjectionFlowConfig config, DataFlow::PathNode source, DataFlow::PathNode sink
1919
where config.hasFlowPath(source, sink)
20-
select sink.getNode(), source, sink, "Potential arbitrary code execution due to $@.",
21-
source.getNode(), "a template value loaded from a remote source."
20+
select sink.getNode(), source, sink, "Template, which may contain code, depends on a $@.",
21+
source.getNode(), "user-provided value"

java/ql/src/Security/CWE/CWE-113/ResponseSplitting.ql

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

4848
from DataFlow::PathNode source, DataFlow::PathNode sink, ResponseSplittingConfig conf
4949
where conf.hasFlowPath(source, sink)
50-
select sink.getNode(), source, sink, "Response-splitting vulnerability due to this $@.",
50+
select sink.getNode(), source, sink,
51+
"This header depends on a $@, which may cause a response-splitting vulnerability.",
5152
source.getNode(), "user-provided value"

java/ql/src/Security/CWE/CWE-113/ResponseSplittingLocal.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@ class ResponseSplittingLocalConfig extends TaintTracking::Configuration {
3131

3232
from DataFlow::PathNode source, DataFlow::PathNode sink, ResponseSplittingLocalConfig conf
3333
where conf.hasFlowPath(source, sink)
34-
select sink.getNode(), source, sink, "Response-splitting vulnerability due to this $@.",
34+
select sink.getNode(), source, sink,
35+
"This header depends on a $@, which may cause a response-splitting vulnerability.",
3536
source.getNode(), "user-provided value"

java/ql/src/Security/CWE/CWE-117/LogInjection.ql

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

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

java/ql/src/Security/CWE/CWE-129/ImproperValidationOfArrayConstruction.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ where
3333
sizeExpr = sink.getNode().asExpr() and
3434
any(Conf conf).hasFlowPath(source, sink)
3535
select arrayAccess.getIndexExpr(), source, sink,
36-
"The $@ is accessed here, but the array is initialized using $@ which may be zero.",
37-
arrayCreation, "array", source.getNode(), "User-provided value"
36+
"This accesses the $@, but the array is initialized using a $@ which may be zero.", arrayCreation,
37+
"array", source.getNode(), "user-provided value"

java/ql/src/Security/CWE/CWE-129/ImproperValidationOfArrayConstructionCodeSpecified.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ where
3838
boundedsource = source.getNode() and
3939
any(BoundedFlowSourceConf conf).hasFlowPath(source, sink)
4040
select arrayAccess.getIndexExpr(), source, sink,
41-
"The $@ is accessed here, but the array is initialized using $@ which may be zero.",
42-
arrayCreation, "array", boundedsource, boundedsource.getDescription().toLowerCase()
41+
"This accesses the $@, but the array is initialized using $@ which may be zero.", arrayCreation,
42+
"array", boundedsource, boundedsource.getDescription().toLowerCase()

java/ql/src/Security/CWE/CWE-129/ImproperValidationOfArrayConstructionLocal.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ where
3434
sizeExpr = sink.getNode().asExpr() and
3535
any(Conf conf).hasFlowPath(source, sink)
3636
select arrayAccess.getIndexExpr(), source, sink,
37-
"The $@ is accessed here, but the array is initialized using $@ which may be zero.",
38-
arrayCreation, "array", source.getNode(), "User-provided value"
37+
"This accesses the $@, but the array is initialized using a $@ which may be zero.", arrayCreation,
38+
"array", source.getNode(), "user-provided value"

java/ql/src/Security/CWE/CWE-129/ImproperValidationOfArrayIndex.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ where
3232
arrayAccess.canThrowOutOfBounds(sink.getNode().asExpr()) and
3333
any(Conf conf).hasFlowPath(source, sink)
3434
select arrayAccess.getIndexExpr(), source, sink,
35-
"$@ flows to here and is used as an index causing an ArrayIndexOutOfBoundsException.",
36-
source.getNode(), "User-provided value"
35+
"This index depends on a $@ which can cause an ArrayIndexOutOfBoundsException.", source.getNode(),
36+
"user-provided value"

java/ql/src/Security/CWE/CWE-129/ImproperValidationOfArrayIndexLocal.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ where
3131
arrayAccess.canThrowOutOfBounds(sink.getNode().asExpr()) and
3232
any(Conf conf).hasFlowPath(source, sink)
3333
select arrayAccess.getIndexExpr(), source, sink,
34-
"$@ flows to here and is used as an index causing an ArrayIndexOutOfBoundsException.",
35-
source.getNode(), "User-provided value"
34+
"This index depends on a $@ which can cause an ArrayIndexOutOfBoundsException.", source.getNode(),
35+
"user-provided value"

java/ql/src/Security/CWE/CWE-134/ExternallyControlledFormatString.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ from
3333
DataFlow::PathNode source, DataFlow::PathNode sink, StringFormat formatCall,
3434
ExternallyControlledFormatStringConfig conf
3535
where conf.hasFlowPath(source, sink) and sink.getNode().asExpr() = formatCall.getFormatArgument()
36-
select formatCall.getFormatArgument(), source, sink,
37-
"$@ flows to here and is used in a format string.", source.getNode(), "User-provided value"
36+
select formatCall.getFormatArgument(), source, sink, "Format string depends on a $@.",
37+
source.getNode(), "user-provided value"

java/ql/src/Security/CWE/CWE-134/ExternallyControlledFormatStringLocal.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ from
3131
DataFlow::PathNode source, DataFlow::PathNode sink, StringFormat formatCall,
3232
ExternallyControlledFormatStringLocalConfig conf
3333
where conf.hasFlowPath(source, sink) and sink.getNode().asExpr() = formatCall.getFormatArgument()
34-
select formatCall.getFormatArgument(), source, sink,
35-
"$@ flows to here and is used in a format string.", source.getNode(), "User-provided value"
34+
select formatCall.getFormatArgument(), source, sink, "Format string depends on $@.",
35+
source.getNode(), "user-provided value"

java/ql/src/Security/CWE/CWE-190/ArithmeticTainted.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ where
4747
underflowSink(exp, sink.getNode().asExpr()) and
4848
effect = "underflow"
4949
select exp, source, sink,
50-
"$@ flows to here and is used in arithmetic, potentially causing an " + effect + ".",
51-
source.getNode(), "User-provided value"
50+
"This arithmetic expression depends on a $@, potentially causing an " + effect + ".",
51+
source.getNode(), "user-provided value"

java/ql/src/Security/CWE/CWE-190/ArithmeticTaintedLocal.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ where
4747
underflowSink(exp, sink.getNode().asExpr()) and
4848
effect = "underflow"
4949
select exp, source, sink,
50-
"$@ flows to here and is used in arithmetic, potentially causing an " + effect + ".",
51-
source.getNode(), "User-provided value"
50+
"This arithmetic expression depends on a $@, potentially causing an " + effect + ".",
51+
source.getNode(), "user-provided value"

java/ql/src/Security/CWE/CWE-190/ArithmeticUncontrolled.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ where
5555
underflowSink(exp, sink.getNode().asExpr()) and
5656
effect = "underflow"
5757
select exp, source, sink,
58-
"$@ flows to here and is used in arithmetic, potentially causing an " + effect + ".",
59-
source.getNode(), "Uncontrolled value"
58+
"This arithmetic expression depends on a $@, potentially causing an " + effect + ".",
59+
source.getNode(), "uncontrolled value"

java/ql/src/Security/CWE/CWE-266/IntentUriPermissionManipulation.ql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ import DataFlow::PathGraph
2020
from DataFlow::PathNode source, DataFlow::PathNode sink
2121
where any(IntentUriPermissionManipulationConf c).hasFlowPath(source, sink)
2222
select sink.getNode(), source, sink,
23-
"This Intent can be set with arbitrary flags from $@, " +
24-
"and used to give access to internal content providers.", source.getNode(), "this user input"
23+
"This Intent can be set with arbitrary flags from a $@, " +
24+
"and used to give access to internal content providers.", source.getNode(),
25+
"user-provided value"

java/ql/src/Security/CWE/CWE-295/InsecureTrustManager.ql

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

1818
from DataFlow::PathNode source, DataFlow::PathNode sink
1919
where any(InsecureTrustManagerConfiguration cfg).hasFlowPath(source, sink)
20-
select sink, source, sink, "This $@, which is defined $@ and trusts any certificate, is used here.",
21-
source, "TrustManager", source.getNode().asExpr().(ClassInstanceExpr).getConstructedType(), "here"
20+
select sink, source, sink, "This uses $@, which is defined in $@ and trusts any certificate.",
21+
source, "TrustManager",
22+
source.getNode().asExpr().(ClassInstanceExpr).getConstructedType() as type, type.nestedName()

java/ql/src/Security/CWE/CWE-297/InsecureJavaMail.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ where
2121
isInsecureMailPropertyConfig(ma.getArgument(0).(VarAccess).getVariable())
2222
or
2323
enablesEmailSsl(ma) and not hasSslCertificateCheck(ma.getQualifier().(VarAccess).getVariable())
24-
select ma, "Java mailing has insecure SSL configuration"
24+
select ma, "Java mailing has insecure SSL configuration."

java/ql/src/Security/CWE/CWE-297/UnsafeHostnameVerification.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,5 @@ where
121121
not isNodeGuardedByFlag(sink.getNode()) and
122122
verifier = source.getNode().asExpr().(ClassInstanceExpr).getConstructedType()
123123
select sink, source, sink,
124-
"$@ that is defined $@ and accepts any certificate as valid, is used here.", source,
125-
"This hostname verifier", verifier, "here"
124+
"The $@ defined by $@ always accepts any certificate, even if the hostname does not match.",
125+
source, "hostname verifier", verifier, "this type"

java/ql/src/Security/CWE/CWE-312/CleartextStorageAndroidDatabase.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ where
2020
input = s.getAnInput() and
2121
store = s.getAStore() and
2222
data.flowsTo(input)
23-
select store, "SQLite database $@ containing $@ is stored $@. Data was added $@.", s, s.toString(),
24-
data, "sensitive data", store, "here", input, "here"
23+
select store, "This stores data in a SQLite database $@ containing $@ which was $@.", s,
24+
s.toString(), data, "sensitive data", input, "previously added"

java/ql/src/Security/CWE/CWE-312/CleartextStorageAndroidFilesystem.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ where
2020
input = s.getAnInput() and
2121
store = s.getAStore() and
2222
data.flowsTo(input)
23-
select store, "Local file $@ containing $@ is stored $@. Data was added $@.", s, s.toString(), data,
24-
"sensitive data", store, "here", input, "here"
23+
select store, "This stores the local file $@ containing $@ which was $@.", s, s.toString(), data,
24+
"sensitive data", input, "previously added"

0 commit comments

Comments
 (0)