Summary
FastGPT's HTTP-tool OpenAPI schema importer previously trusted remote $ref URLs resolved by SwaggerParser without applying internal-address protections.
An authenticated team member could leverage this behavior to trigger server-side HTTP requests to internal services or cloud metadata endpoints, effectively reading sensitive internal data through the importer workflow.
Affected context
This vulnerability occurs in FastGPT deployments that enable the HTTP-tool OpenAPI schema import feature and allow team members to supply external OpenAPI URLs.
The importer validates only the top-level URL, then delegates remote reference resolution to SwaggerParser, which issues HTTP requests to $ref locations without enforcing FastGPT's internal-address guard.
In environments where the FastGPT server can reach internal network services or cloud instance metadata endpoints, this behavior can expose internal responses back through the import process.
Exploit preconditions
- Attack surface: HTTP-tool OpenAPI schema importer endpoint exposed to authenticated users.
- Required access: Authenticated membership in a FastGPT team with permission to configure tools or import OpenAPI schemas.
- Trigger point: Submitting an OpenAPI document or URL whose referenced $ref paths cause the server to request internal or metadata URLs during SwaggerParser.bundle processing.
- Why exploitation is possible: The system validates only the primary URL and does not re-apply internal-address restrictions to remotely resolved $ref URLs, allowing the parser to act as a blind HTTP client to internal resources.
Why this happens
The underlying issue is improper control of server-initiated HTTP requests introduced by delegating remote reference resolution to SwaggerParser without enforcing FastGPT's own network access guards.
This maps to CWE-918: Server-Side Request Forgery (SSRF), where user-supplied URLs indirectly drive backend HTTP requests and can reach internal or otherwise protected endpoints.
In abstract terms, the bug class is trusting externally influenced URLs embedded in OpenAPI $ref entries, treating them as safe configuration rather than untrusted input, and failing to consistently apply internal-address filtering for all outbound requests.
Potential impact
- An attacker may read responses from internal microservices not directly exposed to the internet.
- An attacker could access cloud instance metadata endpoints and potentially obtain credentials or security tokens.
- An attacker can map parts of the internal network reachable from the FastGPT server.
- Sensitive configuration, diagnostics, or health-check data from internal services could be disclosed.
General mitigation guidance
Mitigation typically involves tightening control over server-initiated HTTP requests and treating all externally influenced URLs as untrusted input.
Common defensive patterns include:
- Enforcing a single, centralized network access guard that is applied to all outbound HTTP requests, including those made by third-party libraries and remote reference resolvers.
- Restricting allowed URL schemes, domains, and IP ranges, and explicitly blocking access to private address spaces and cloud instance metadata endpoints.
- Limiting who can configure or invoke remote OpenAPI imports, and reducing the trust placed in user-supplied schema URLs.
- Designing the importer to resolve references only from whitelisted locations or via a controlled proxy that applies strict policy checks.
- Running the application with least-privilege network access, segmenting internal services so that the application cannot freely reach sensitive endpoints.
How teams detect issues like this
Detection efforts can focus on identifying SSRF-like traffic patterns and risky URL handling in code paths related to schema import and HTTP tooling.
Useful strategies include:
- Static analysis rules that flag dynamic URL usage or remote reference resolution without address validation, particularly in OpenAPI parsers and HTTP client wrappers.
- Code reviews that look for delegation to third-party libraries (such as Swagger/OpenAPI tools) where outbound requests are made without centralized network policy enforcement.
- Runtime monitoring for unusual outbound requests from the FastGPT server to internal IP ranges or metadata endpoints, supported by network-level logging and anomaly detection.
- Policy enforcement in CI/CD that restricts use of generic HTTP clients or parsers unless they are wired through vetted network guard components.

