Skip to content

Commit 9774b24

Browse files
author
edvraa
committed
Use TypeString
1 parent 452ec8c commit 9774b24

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

java/ql/src/experimental/Security/CWE/CWE-730/RegexInjection.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class RegexSink extends DataFlow::ExprNode {
2424
RegexSink() {
2525
exists(MethodAccess ma, Method m | m = ma.getMethod() |
2626
(
27-
m.getDeclaringType().hasQualifiedName("java.lang", "String") and
27+
m.getDeclaringType() instanceof TypeString and
2828
(
2929
ma.getArgument(0) = this.asExpr() and
3030
(
@@ -47,7 +47,7 @@ class RegexSink extends DataFlow::ExprNode {
4747
m.getDeclaringType().hasQualifiedName("org.apache.commons.lang3", "RegExUtils") and
4848
(
4949
ma.getArgument(1) = this.asExpr() and
50-
m.getParameterType(1).(Class).hasQualifiedName("java.lang", "String") and
50+
m.getParameterType(1).(Class) instanceof TypeString and
5151
(
5252
m.hasName("removeAll") or
5353
m.hasName("removeFirst") or

0 commit comments

Comments
 (0)