/

CVE-2026-42302

Severity:

CRITICAL RISK

(9.8)

Missing Authentication for Critical Function in FastGPT

CVE-2026-42302

Deferred

Vulnerability type

Category:

Missing Authentication for Critical Function

CWE:

CWE-306

Impact:

Unauthenticated Remote Code Execution

Severity:

CRITICAL RISK

(9.8)

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 agent-sandbox component in affected versions of FastGPT exposes a code-server instance without authentication and binds it to all network interfaces.

Any user with network access to the exposed port can execute arbitrary code and gain full control over the sandbox environment, resulting in unauthenticated remote code execution (RCE).

Affected context

This vulnerability affects FastGPT deployments that run the agent-sandbox component with a startup script (entrypoint.sh) configured to launch code-server using --auth none and listening on 0.0.0.0:8080.

It is relevant when the sandbox port is reachable from untrusted or semi-trusted networks, such as shared Kubernetes clusters, cloud environments with broad security group rules, or internal networks where lateral movement is a concern.

The risk is elevated when the sandbox environment has access to sensitive data, internal services, or elevated execution permissions beyond an isolated, strictly locked-down container.

Exploit preconditions

  • Attack surface: Network-accessible code-server instance inside the agent-sandbox component.
  • Required access: Ability to reach the sandbox port (typically 8080/TCP) over the network; no authentication or prior access is required.
  • Trigger point: Connecting to the exposed code-server endpoint and interacting with the interface as if authenticated.
  • Why exploitation is possible: The --auth none flag completely disables authentication while the service is bound to 0.0.0.0, making a powerful code-execution interface directly accessible to any network client that can reach the port.

Why this happens

The underlying bug is a missing authentication and access-control check on a critical functionality: a remotely accessible code execution environment.

The startup script configures code-server with --auth none, effectively removing any identity verification, and simultaneously binds it to all interfaces (0.0.0.0), broadening exposure.

This maps to CWE-306: Missing Authentication for Critical Function, because a highly privileged operation—executing arbitrary code in the sandbox—is exposed without requiring any form of authentication or authorization.

Conceptually, it represents an insecure-by-default configuration where a powerful administrative interface is placed directly on the network without a protection boundary.

Potential impact

  • Remote attackers may execute arbitrary code within the sandbox container.
  • Attackers could read, modify, or delete files and data accessible from the sandbox environment.
  • Lateral movement may be possible if the sandbox can reach internal services or metadata endpoints.
  • Attackers could deploy malicious agents, scripts, or tooling to stage further attacks.
  • Integrity and availability of the FastGPT environment may be degraded or completely compromised.

General mitigation guidance

Effective mitigation focuses on enforcing strong access controls for any exposed code execution interfaces and applying secure-by-default configurations:

  • Require authentication for code-server or any similar management or development interfaces, using robust, centrally managed credentials or SSO.
  • Bind sensitive services to loopback or internal-only interfaces by default, and use reverse proxies or API gateways with strict access control when external exposure is necessary.
  • Apply network segmentation and firewall rules so that sandbox environments are not directly reachable from untrusted networks.
  • Run sandbox components with least privilege and strict isolation to limit the blast radius if they are compromised.
  • Adopt secure configuration baselines and configuration-as-code reviews to prevent insecure flags such as --auth none from being deployed inadvertently.

How teams detect issues like this

Detection typically includes both configuration and behavioral monitoring:

  • Perform automated configuration reviews or infrastructure-as-code scanning to flag services launched with no authentication (e.g., --auth none) or bound to 0.0.0.0.
  • Use network scanning and attack-surface management tools to identify exposed code-server instances and other administrative interfaces.
  • Add static analysis or policy-as-code rules that prevent insecure startup flags, container arguments, or environment variables from being merged into deployment pipelines.
  • Monitor logs for unusual access patterns to sandbox endpoints, such as unexpected IPs, high-frequency connections, or anomalous activity suggesting interactive development sessions from unknown sources.

Sources

SourceLink
github.comgithub.com/labring/FastGPT/commit/9d1cafce9241430fb5bcdd646455055c5f4ae0a4
github.comgithub.com/labring/FastGPT/pull/6781
github.comgithub.com/labring/FastGPT/releases/tag/v4.14.13
github.comgithub.com/labring/FastGPT/security/advisories/GHSA-34rc-438g-7w78

Frequently asked

questions

It can be, if the sandbox port is exposed beyond trusted networks (for example, via a public IP, misconfigured security groups, or port-forwarding). If limited to a tightly controlled internal network, the risk is constrained to those who can reach that network.

No. Due to the --auth none configuration, no credentials are required. Any party that can connect to the exposed port can interact with the code-server environment as an authenticated user.

Ensure that all remote management and code-execution interfaces enforce authentication and are bound only to appropriate interfaces. Combine this with network-level controls so that only authorized users and systems can reach these endpoints.

Establish secure defaults for all components, enforce configuration and infrastructure-as-code reviews, and add automated checks that block deployments with unauthenticated critical services or globally bound administrative ports. Regularly inventory and test exposed services to validate that authentication and access control policies are consistently applied.

Find out what's already
exploitable in your codebase.