Skip to content

Commit d50f220

Browse files
committed
fix most al/alert-message-violation in Java
1 parent 19ff293 commit d50f220

File tree

63 files changed

+98
-100
lines changed

Some content is hidden

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

63 files changed

+98
-100
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 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.",
76+
scc, "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/Nullness/NullAlways.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ 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(), 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/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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ 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 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, "Command line depends on $@.", source.getNode(),
24-
"a 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-094/InsecureBeanValidation.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,4 @@ where
8181
) and
8282
cfg.hasFlowPath(source, sink)
8383
select sink.getNode(), source, sink,
84-
"Custom constraint error message contains unsanitized user data"
84+
"Custom constraint error message contains unsanitized user data."

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/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-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+
"This uses a $@ that is defined $@ and accepts any certificate as valid.", source,
125+
"hostname verifier", verifier, "here"

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"

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

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

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ where
1818
input = s.getAnInput() and
1919
store = s.getAStore() and
2020
data.flowsTo(input)
21-
select store, "Cookie $@ containing $@ is stored here. Data was added $@.", s, s.toString(), data,
22-
"sensitive data", input, "here"
21+
select store, "This stores cookie $@ containing $@ which was $@.", s, s.toString(), data,
22+
"sensitive data", input, "added to the cookie"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ where
1818
input = s.getAnInput() and
1919
store = s.getAStore() and
2020
data.flowsTo(input)
21-
select store, "'Properties' class $@ containing $@ is stored here. Data was added $@.", s,
22-
s.toString(), data, "sensitive data", input, "here"
21+
select store, "This stores 'Properties' class $@ containing $@ which was $@.", s, s.toString(),
22+
data, "sensitive data", input, "previously added"

java/ql/src/Security/CWE/CWE-312/CleartextStorageSharedPrefs.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, "'SharedPreferences' class $@ containing $@ is stored $@. Data was added $@.", s,
24-
s.toString(), data, "sensitive data", store, "here", input, "here"
23+
select store, "This stores the 'SharedPreferences' class $@ containing $@ which $@.", s,
24+
s.toString(), data, "sensitive data", input, "was set as a shared preference"

java/ql/src/Security/CWE/CWE-347/MissingJWTSignatureCheck.ql

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

1717
from DataFlow::PathNode source, DataFlow::PathNode sink, MissingJwtSignatureCheckConf conf
1818
where conf.hasFlowPath(source, sink)
19-
select sink.getNode(), source, sink, "A signing key is set $@, but the signature is not verified.",
20-
source.getNode(), "here"
19+
select sink.getNode(), source, sink, "This parses a $@, but the signature is not verified.",
20+
source.getNode(), "JWT signing key"

java/ql/src/Security/CWE/CWE-367/TOCTOURace.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,5 @@ where
121121
// The synchronized methods on `Throwable` are not interesting.
122122
not call1.getCallee().getDeclaringType() instanceof TypeThrowable
123123
select call2,
124-
"The state of $@ is checked $@, and then it is used here. But these are not jointly synchronized.",
125-
r, r.getName(), call1, "here"
124+
"This uses the state of $@ which is checked $@. But these are not jointly synchronized.", r,
125+
r.getName(), call1, "here"

java/ql/src/Security/CWE/CWE-643/XPathInjection.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ class XPathInjectionConfiguration extends TaintTracking::Configuration {
2727

2828
from DataFlow::PathNode source, DataFlow::PathNode sink, XPathInjectionConfiguration c
2929
where c.hasFlowPath(source, sink)
30-
select sink.getNode(), source, sink, "$@ flows to here and is used in an XPath expression.",
31-
source.getNode(), "User-provided value"
30+
select sink.getNode(), source, sink, "XPath expression depends on a $@.", source.getNode(),
31+
"user-provided value"

java/ql/src/Security/CWE/CWE-681/NumericCastTainted.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ where
4444
sink.getNode().asExpr() = exp.getExpr() and
4545
conf.hasFlowPath(source, sink)
4646
select exp, source, sink,
47-
"$@ flows to here and is cast to a narrower type, potentially causing truncation.",
48-
source.getNode(), "User-provided value"
47+
"This cast to a narrower type depends on a $@, potentially causing truncation.", source.getNode(),
48+
"User-provided value"

java/ql/src/Security/CWE/CWE-681/NumericCastTaintedLocal.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ where
4646
conf.hasFlowPath(source, sink) and
4747
not exists(RightShiftOp e | e.getShiftedVariable() = tainted.getVariable())
4848
select exp, source, sink,
49-
"$@ flows to here and is cast to a narrower type, potentially causing truncation.",
50-
source.getNode(), "User-provided value"
49+
"This cast to a narrower type depends on a $@, potentially causing truncation.", source.getNode(),
50+
"User-provided value"

java/ql/src/Security/CWE/CWE-732/ReadingFromWorldWritableFile.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ where
2222
fileVariable.getAnAccess() = setWorldWritable.getFileVarAccess() and
2323
// If the file variable is a parameter, the result should be reported in the caller.
2424
not fileVariable instanceof Parameter
25-
select setWorldWritable, "A file is set to be world writable here, but is read from $@.", readFrom,
25+
select setWorldWritable, "This sets a file is as world writable, but is read from $@.", readFrom,
2626
"statement"

java/ql/src/Security/CWE/CWE-780/RsaWithoutOaep.ql

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

1717
from RsaWithoutOaepConfig conf, DataFlow::PathNode source, DataFlow::PathNode sink
1818
where conf.hasFlowPath(source, sink)
19-
select source, source, sink,
20-
"This specification is used to initialize an RSA cipher without OAEP padding $@.", sink, "here"
19+
select source, source, sink, "This specification is used to $@ without OAEP padding.", sink,
20+
"initialize an RSA cipher"

java/ql/src/Security/CWE/CWE-925/ImproperIntentVerification.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ import semmle.code.java.security.ImproperIntentVerificationQuery
1515

1616
from AndroidReceiverXmlElement reg, Method orm, SystemActionName sa
1717
where unverifiedSystemReceiver(reg, orm, sa)
18-
select orm, "This reciever doesn't verify intents it receives, and is registered $@ to receive $@.",
19-
reg, "here", sa, "the system action " + sa.getName()
18+
select orm, "This reciever doesn't verify intents it receives, and $@ to receive $@.", reg,
19+
"it is registered", sa, "the system action " + sa.getName()

java/ql/src/Security/CWE/CWE-927/ImplicitPendingIntents.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ import DataFlow::PathGraph
2020
from DataFlow::PathNode source, DataFlow::PathNode sink
2121
where any(ImplicitPendingIntentStartConf conf).hasFlowPath(source, sink)
2222
select sink.getNode(), source, sink,
23-
"An implicit Intent is created $@ and sent to an unspecified third party through a PendingIntent.",
24-
source.getNode(), "here"
23+
"$@ and sent to an unspecified third party through a PendingIntent.", source.getNode(),
24+
"An implicit Intent is created"

java/ql/src/Security/CWE/CWE-927/SensitiveCommunication.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 SensitiveCommunicationConfig cfg, DataFlow::PathNode source, DataFlow::PathNode sink
1919
where cfg.hasFlowPath(source, sink)
20-
select sink.getNode(), source, sink, "This call may leak sensitive information from $@.",
21-
source.getNode(), "here"
20+
select sink.getNode(), source, sink, "This call may leak $@.", source.getNode(),
21+
"sensitive information"

java/ql/src/Violations of Best Practice/Dead Code/NonAssignedFields.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,5 @@ where
8787
// Exclude special VM classes.
8888
not isVMObserver(f.getDeclaringType())
8989
select f,
90-
"The field '" + f.getName() + "' is never explicitly assigned a value, yet it is read $@.", fr,
91-
"here"
90+
"The field '" + f.getName() + "' is never explicitly assigned a value, yet $@.", fr,
91+
"the field is read"

java/ql/src/Violations of Best Practice/Undesirable Calls/NextFromIterator.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ where
2323
hasNext.getDeclaringType().getSourceDeclaration().getAnAncestor() = i and
2424
hasNext.hasName("hasNext")
2525
)
26-
select m, "next() called from within an Iterator method."
26+
select m, "This calls 'next()' from within an Iterator method."

java/ql/src/experimental/Security/CWE/CWE-020/Log4jJndiInjection.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,5 +203,5 @@ class Log4jInjectionConfiguration extends TaintTracking::Configuration {
203203

204204
from Log4jInjectionConfiguration cfg, DataFlow::PathNode source, DataFlow::PathNode sink
205205
where cfg.hasFlowPath(source, sink)
206-
select sink.getNode(), source, sink, "This $@ flows to a Log4j log entry.", source.getNode(),
206+
select sink.getNode(), source, sink, "Log4j log entry depends on a $@.", source.getNode(),
207207
"user-provided value"

0 commit comments

Comments
 (0)