Skip to content

Commit dec517d

Browse files
committed
fix: restrict .internal SSRF allowlist to host.docker.internal only
1 parent 9e3d8ce commit dec517d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

apps/sim/app/api/knowledge/route.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@ const CreateKnowledgeBaseSchema = z.object({
8383
}
8484
return false
8585
}
86-
// Allow Docker service hostnames (no dots = not a public domain)
87-
// e.g. "ollama", "host.docker.internal"
88-
if (!hostname.includes('.') || hostname.endsWith('.internal')) {
86+
// Allow Docker service hostnames (no dots = not a public domain, e.g. "ollama")
87+
// or the well-known Docker Desktop host alias. Do NOT allow all *.internal domains —
88+
// they are not universally restricted and could be DNS-resolved to cloud metadata IPs.
89+
if (!hostname.includes('.') || hostname === 'host.docker.internal') {
8990
return true
9091
}
9192
return false

0 commit comments

Comments
 (0)