/

CVE-2026-39885

Severity:

HIGH RISK

(7.5)

SSRF in FrontMCP mcp-from-openapi Dereferencing

CVE-2026-39885

Analyzed

Vulnerability type

Category:

Server-Side Request Forgery (SSRF)

CWE:

CWE-918

Impact:

Server-Side Request Forgery and Local File Disclosure

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

The mcp-from-openapi library in FrontMCP dereferences $ref pointers in OpenAPI specifications without restricting which URLs or file paths can be accessed.

When an untrusted OpenAPI spec is processed, a malicious actor can embed $ref values that cause the server to make internal network requests or read local files, enabling SSRF and local file disclosure during the initialize() call.

Affected context

This vulnerability appears in applications that:

  • Integrate FrontMCP's mcp-from-openapi library
  • Accept or process OpenAPI specifications from external or partially trusted sources
  • Allow mcp-from-openapi to automatically dereference $ref pointers using default json-schema-ref-parser behavior

The risk is most pronounced when the MCP implementation runs in an environment with access to internal services, cloud metadata endpoints, or sensitive files on disk.

Exploit preconditions

  • Attack surface: The code path that ingests and initializes OpenAPI specifications via mcp-from-openapi (e.g., API upload endpoints, configuration loading, or dynamic connector setup).
  • Required access: Ability to supply or influence the OpenAPI specification consumed by the server (authenticated or unauthenticated, depending on the application).
  • Trigger point: Invocation of the library's initialize() (or equivalent) routine, which triggers dereferencing of $ref entries using json-schema-ref-parser.
  • Why exploitation is possible: The dereferencer follows arbitrary URLs and file paths without:
  • Restricting schemes, hosts, or paths, or
  • Using custom resolvers to enforce a safe allowlist/denylist.

As a result, $ref values can point to internal URLs (e.g., http://127.0.0.1, VPC-only hosts, metadata services) or local resources (e.g., file:///etc/passwd), and the server will fetch them on the attacker's behalf.

Why this happens

The underlying issue is the lack of trust boundary enforcement in automated reference resolution of structured specifications.

The mcp-from-openapi library delegates $ref dereferencing to @apidevtools/json-schema-ref-parser with default behavior, which treats all referenced locations as equally trustworthy and reachable.

This maps to CWE-918: Server-Side Request Forgery (SSRF) because the server is coerced into issuing arbitrary outbound requests based on attacker-controlled input.

Additionally, because the dereferencer supports local file and non-network schemes, the same flaw leads to unintended local file read, turning what should be a pure data interpretation step into a generalized retrieval primitive that crosses security boundaries.

Potential impact

  • An attacker could induce requests to internal HTTP(S) services, potentially:
  • Enumerating internal endpoints and ports
  • Accessing admin-only or management interfaces not exposed to the public internet
  • Bypassing network ACLs and IP-based access controls
  • The server could be tricked into calling cloud provider metadata endpoints, which may:
  • Expose temporary credentials and access tokens
  • Reveal environment-specific secrets or configuration
  • Local file paths may be dereferenced, which can:
  • Disclose sensitive configuration files (keys, tokens, database credentials)
  • Leak source code or environment-specific secrets
  • Combined with other issues (such as overly verbose error messages or response reflection), this behavior may facilitate:
  • Lateral movement within the infrastructure
  • Further privilege escalation and data exfiltration

General mitigation guidance

Effective mitigation focuses on constraining what the dereferencing step is allowed to reach and how untrusted OpenAPI content is handled:

  • Treat all externally supplied OpenAPI specifications as untrusted data unless explicitly vetted.
  • Configure JSON Schema/OpenAPI dereferencing libraries with:
  • Strict allowlists of permitted protocols (e.g., only https://) and hostnames
  • Explicit denylists for loopback, link-local, and metadata IP ranges (e.g., 127.0.0.0/8, 169.254.169.254, 10.0.0.0/8)
  • Disabling file:// or other non-HTTP schemes when they are not strictly required.
  • Prefer using custom resolvers that:
  • Resolve $ref only from a controlled, pre-fetched set of documents
  • Avoid performing arbitrary outbound network requests at dereference time.
  • Isolate services that process untrusted OpenAPI definitions:
  • Run them in constrained network segments with minimal internal reachability
  • Apply least-privilege OS permissions to limit access to local files.
  • Normalize workflows so that specification upload/consumption is decoupled from production credentials and sensitive infrastructure, reducing the blast radius if dereferencing is abused.

How teams detect issues like this

Detection efforts should aim to identify both the insecure dereferencing pattern in code and unusual access patterns at runtime:

  • Static analysis and code review:
  • Look for uses of @apidevtools/json-schema-ref-parser (or similar tools) that call dereference() or resolve() on untrusted data without:
  • Custom resolvers
  • Scheme/host restrictions
  • Any explicit network or file access policies.
  • Flag places where external OpenAPI specifications are accepted and immediately fed into automatic dereferencing routines.
  • Integrate secure coding guidelines into pull request templates, calling out SSRF risks when using schema dereferencers.
  • Configuration and policy checks:
  • Implement linting rules or CI checks that disallow default dereferencing behavior on untrusted specs.
  • Enforce infrastructure policies that block outbound traffic to metadata IPs and restrict egress to defined destinations.
  • Runtime monitoring:
  • Monitor server logs and egress traffic for unexpected outbound requests triggered during OpenAPI processing.
  • Set alerts for requests to loopback (127.0.0.1), link-local, or known cloud metadata endpoints.
  • Automated security testing tools (DAST/SAST) can be configured to:
  • Submit malicious OpenAPI documents containing internal/metadata $ref targets
  • Detect whether the application attempts to fetch those endpoints during initialization.

Sources

SourceLink
github.comgithub.com/agentfront/frontmcp/releases/tag/v1.0.4
github.comgithub.com/agentfront/frontmcp/security/advisories/GHSA-v6ph-xcq9-qxxj

Frequently asked

questions

Yes, if an attacker can provide or modify the OpenAPI specification consumed by the server, they can exploit the vulnerability remotely by embedding malicious $ref values that cause SSRF or local file access during dereferencing.

The attacker must be able to influence the OpenAPI document processed by mcp-from-openapi—through an upload endpoint, configuration integration, or any mechanism that accepts external specs. No direct filesystem or network access to the server is required beyond that entry point.

The most robust fix is to harden the dereferencing process: restrict or disable network and file access during schema resolution for untrusted specs, use custom resolvers with strict allowlists, and isolate the processing environment so that even if dereferencing occurs, it cannot reach sensitive internal services or files.

When using tools that automatically follow references or links (such as schema dereferencers, HTTP clients, or templating engines), explicitly model trust boundaries and apply defense-in-depth: avoid default behaviors, enforce protocol/host/path restrictions, treat external specifications as untrusted input, and test for SSRF-like behavior as part of routine security reviews.

Find out what's already
exploitable in your codebase.