Files
codeql/java/ql/test/query-tests/security/CWE-730/RegexInjectionTest.ql
2023-03-24 10:04:46 -04:00

19 lines
647 B
Plaintext

import java
import TestUtilities.InlineExpectationsTest
import semmle.code.java.security.regexp.RegexInjectionQuery
class RegexInjectionTest extends InlineExpectationsTest {
RegexInjectionTest() { this = "RegexInjectionTest" }
override string getARelevantTag() { result = "hasRegexInjection" }
override predicate hasActualResult(Location location, string element, string tag, string value) {
tag = "hasRegexInjection" and
exists(RegexInjectionFlow::PathNode sink | RegexInjectionFlow::flowPath(_, sink) |
location = sink.getNode().getLocation() and
element = sink.getNode().toString() and
value = ""
)
}
}