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-serverinstance 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-serverendpoint and interacting with the interface as if authenticated. - Why exploitation is possible: The
--auth noneflag completely disables authentication while the service is bound to0.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-serveror 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 nonefrom 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 to0.0.0.0. - Use network scanning and attack-surface management tools to identify exposed
code-serverinstances 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.

