Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix(github): validate cloud API subdomain to enhance SSRF protection

Victor Hugo dos Santosbc21d1d8abb3
diff --git a/backend/src/services/app-connection/github/github-connection-fns.ts b/backend/src/services/app-connection/github/github-connection-fns.ts
index 481b4eac88..337700ebf0 100644
--- a/backend/src/services/app-connection/github/github-connection-fns.ts
+++ b/backend/src/services/app-connection/github/github-connection-fns.ts
@@ -43,6 +43,10 @@ export const getGitHubInstanceApiUrl = async (config: {
if (config.credentials.instanceType === "server") {
apiBase = `${host}/api/v3`;
} else {
+ // The cloud API lives on a separate subdomain (api.${host}) that resolves
+ // independently from the root host, so it must be validated too — otherwise a
+ // split-DNS host (root public, api.* internal) bypasses the SSRF guard.
+ await blockLocalAndPrivateIpAddresses(`https://api.${host}`);
apiBase = `api.${host}`;
}