Skip to content

Security: unrestricted URL fetch in load_api_specification (CWE-918 class) #123

Description

@pureacech

Summary

src/mockloop_mcp/parser.pyload_api_specification fetches arbitrary http(s) URLs via requests.get(spec_source) when the source is a URL string.

Impact

If untrusted input can reach spec_source, this is a classic SSRF-class surface (internal HTTP, link-local/metadata depending on deployment network).

Suggested fix direction

  • Allowlist hosts or require explicit user confirmation for remote specs
  • Block private/link-local/metadata CIDRs after DNS resolution
  • Cap redirects and response size

I can draft a small hardening patch if welcome.

— pureace (@pureacech)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions