Skip to content

Commit 7f8cd5e

Browse files
committed
If the hostname is an IP, skip the stored ssrf vulnerability
1 parent bc94f98 commit 7f8cd5e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • agent_api/src/main/java/dev/aikido/agent_api/vulnerabilities/ssrf/imds

agent_api/src/main/java/dev/aikido/agent_api/vulnerabilities/ssrf/imds/Resolver.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ public static String resolvesToImdsIp(Set<String> resolvedIpAddresses, String ho
1414
return null;
1515
}
1616
for (String ip : resolvedIpAddresses) {
17+
if (hostname.trim().equals(ip.trim())) {
18+
// If the hostname is the IP, that means no resolving is happening
19+
// so the request is safe.
20+
continue;
21+
}
1722
if (IMDSAddresses.isImdsIpAddress(ip)) {
1823
return ip;
1924
}

0 commit comments

Comments
 (0)