Skip to content

Security: deep scan makes outbound HTTP calls to URLs from scanned configs #25

@jonathansantilli

Description

@jonathansantilli

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.tsexecuteDeepResource default implementation
  • src/layer3-dynamic/resource-fetcher.tsfetchResourceMetadata() calls fetch() on untrusted URLs
  • src/layer3-dynamic/tool-description-acquisition.tsacquireToolDescriptions() 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions