fix(apollo): validate forwarded client IP headers
loading diff…
x-composio-client-ip or x-real-ip verbatim, allowing attacker-controlled header values to influence banned-IP checks, API-key IP allowlists, and the global per-IP rate limiter.normalizeClientIp and IPv4/IPv6 validators in apps/apollo/src/server/context/utils/get_client_ip.ts so only syntactically valid IPs are accepted.getClientIpFromHeaders to use the validated chain: accept x-composio-client-ip only when the proxy secret matches and the forwarded IP validates, then fall through to cf-connecting-ip, true-client-ip, x-vercel-forwarded-for, x-forwarded-for, and finally validated x-real-ip.apps/apollo/src/server/constants/header.ts and expanded unit tests in apps/apollo/src/server/context/utils/__tests__/get_client_ip.unit.test.ts to cover normalization, trusted-proxy behavior, fallback header priority, and rejection of invalid header values.timingSafeEquals and preserved the existing unknown-IP sentinel UNKNOWN_CLIENT_IP semantics.pnpm --filter @composio/lib build which completed successfully.cd apps/apollo && pnpm exec oxlint ... and the changed-file lint run passed.pnpm --filter @composio/apollo exec vitest run src/server/context/utils/__tests__/get_client_ip.unit.test.ts but execution was blocked by local bootstrap issues (missing Doppler/env and generated Prisma client).PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING=1 pnpm --filter @composio/db db:generate to generate Prisma artifacts but that failed due to Prisma engine download returning HTTP 403; these infra issues prevented full CI-style unit test execution in this environment.