mirror of
https://github.com/github/codeql.git
synced 2026-04-24 00:05:14 +02:00
Exclude loopback address from reverse DNS source
This commit is contained in:
@@ -126,7 +126,7 @@ private class ReverseDnsSource extends RemoteFlowSource {
|
||||
m.getMethod() instanceof ReverseDnsMethod and
|
||||
not exists(MethodCall l |
|
||||
(variableStep(l, m.getQualifier()) or l = m.getQualifier()) and
|
||||
l.getMethod().getName() = "getLocalHost"
|
||||
(l.getMethod().getName() = "getLocalHost" or l.getMethod().getName() = "getLoopbackAddress")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -53,10 +53,10 @@ class ConditionalBypassTest {
|
||||
InetAddress loopback = InetAddress.getLoopbackAddress();
|
||||
// GOOD: reverse DNS on loopback address is fine
|
||||
if (loopback.getCanonicalHostName().equals("localhost")) {
|
||||
login(user, password); // $ SPURIOUS: hasConditionalBypassTest
|
||||
login(user, password); // $ hasConditionalBypassTest
|
||||
}
|
||||
if (Inet4Address.getLoopbackAddress().getCanonicalHostName().equals("localhost")) {
|
||||
login(user, password); // $ SPURIOUS: hasConditionalBypassTest
|
||||
login(user, password); // $ hasConditionalBypassTest
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user