Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 819a599 commit 7a9381fCopy full SHA for 7a9381f
1 file changed
java/ql/src/experimental/CWE-939/IncorrectURLVerification.ql
@@ -63,9 +63,11 @@ class HostVerificationMethodAccess extends MethodAccess {
63
.getRepresentedString()
64
.charAt(0) != "." //"."+var2, check string constant "." e.g. String domainName = "example.com"; Uri.parse(url).getHost().endsWith("www."+domainName)
65
or
66
- exists(MethodAccess ma |
+ exists(MethodAccess ma, Method m |
67
this.getArgument(0) = ma and
68
- ma.getMethod().hasName("getString") and
+ ma.getMethod() = m and
69
+ m.hasName("getString") and
70
+ m.getDeclaringType().getQualifiedName() = "android.content.res.Resources" and
71
ma.getArgument(0).toString().indexOf("R.string") = 0
72
) //Check resource properties in /res/values/strings.xml in Android mobile applications using res.getString(R.string.key)
73
0 commit comments