Description
During Layer 3 deep scan, CodeGate makes outbound HTTP requests to MCP server URLs discovered in scanned configuration files. This is a security risk — the URLs come from untrusted sources (the files being scanned for malicious content) and connecting to them exposes the scanner to:
- Malicious server responses (crafted payloads, malformed JSON, content-length attacks)
- IP address logging (the server learns who is scanning)
- SSRF if CodeGate runs in a cloud/internal network
- Browser tab opening (observed in practice during batch scanning)
Affected Code
src/cli.ts — executeDeepResource default implementation
src/layer3-dynamic/resource-fetcher.ts — fetchResourceMetadata() calls fetch() on untrusted URLs
src/layer3-dynamic/tool-description-acquisition.ts — acquireToolDescriptions() connects to MCP servers
Fix Applied
The executeDeepResource in cli.ts has been changed to never make outbound HTTP calls. Instead it records the URL as metadata for the meta-agent to analyze without connecting.
Remaining Work
- The
resource-fetcher.ts and tool-description-acquisition.ts modules still contain the HTTP-calling code — not removed since other integrations may use them with explicit opt-in
- Consider whether any legitimate use case requires connecting to MCP endpoints during scan, and if so, add explicit user consent with clear warnings
- Add tests verifying that no outbound calls are made during
codegate scan --deep
Description
During Layer 3 deep scan, CodeGate makes outbound HTTP requests to MCP server URLs discovered in scanned configuration files. This is a security risk — the URLs come from untrusted sources (the files being scanned for malicious content) and connecting to them exposes the scanner to:
Affected Code
src/cli.ts—executeDeepResourcedefault implementationsrc/layer3-dynamic/resource-fetcher.ts—fetchResourceMetadata()callsfetch()on untrusted URLssrc/layer3-dynamic/tool-description-acquisition.ts—acquireToolDescriptions()connects to MCP serversFix Applied
The
executeDeepResourceincli.tshas been changed to never make outbound HTTP calls. Instead it records the URL as metadata for the meta-agent to analyze without connecting.Remaining Work
resource-fetcher.tsandtool-description-acquisition.tsmodules still contain the HTTP-calling code — not removed since other integrations may use them with explicit opt-incodegate scan --deep