We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 098b732 commit 5973f3fCopy full SHA for 5973f3f
1 file changed
java/ql/test/query-tests/security/CWE-807/semmle/tests/ConditionalBypassTest.java
@@ -49,6 +49,15 @@ public static void main(HttpServletRequest request) throws Exception {
49
if (Inet4Address.getLocalHost().getCanonicalHostName().equals("localhost")) {
50
login(user, password);
51
}
52
+
53
+ InetAddress loopback = InetAddress.getLoopbackAddress();
54
+ // GOOD: reverse DNS on loopback address is fine
55
+ if (loopback.getCanonicalHostName().equals("localhost")) {
56
+ login(user, password); // $ SPURIOUS: hasConditionalBypassTest
57
+ }
58
+ if (Inet4Address.getLoopbackAddress().getCanonicalHostName().equals("localhost")) {
59
60
61
62
63
public static void test(String user, String password) {
0 commit comments