Critical (9.8)

FastGPT NoSQL injection grants admin login (CVE-2026-40351)

CVE-2026-40351

FastGPT is an AI Agent building platform. In versions prior to 4.14.9.5, the password-based login endpoint uses TypeScript type assertion without runtime validation, allowing an unauthenticated attack...

Overview

A critical security vulnerability in the FastGPT AI Agent platform allows an attacker to bypass authentication and log in as any user account without a password. The flaw, tracked as CVE-2026-40351, is present in versions prior to 4.14.9.5 and has received the maximum CVSS severity score of 9.8.

Vulnerability Details

The vulnerability exists in the password-based login endpoint. The code used TypeScript type assertions, which do not perform runtime validation, to process user input. This allowed an attacker to submit a MongoDB query operator-such as {"$ne": ""} (which means “not equal to empty”)-as the password field.

Because the system did not properly validate this input, the malicious query would be passed directly to the database. The query would succeed, tricking the application into thinking the correct password was supplied. This is a classic NoSQL injection attack.

Impact

The impact of this vulnerability is severe. An unauthenticated attacker on the network could exploit this flaw to log in to the FastGPT application as any existing user. This includes the platform’s root administrator account, granting the attacker full control over the AI agent environment. With administrative access, an attacker could steal sensitive data, manipulate AI agents, deploy malicious code, or use the platform as a foothold for further attacks within the network.

Remediation and Mitigation

The vendor has released a fix in FastGPT version 4.14.9.5. All users must upgrade to this version or a later patched release immediately.

Action Required:

  1. Update: Upgrade your FastGPT installation to version 4.14.9.5 or higher without delay.
  2. Investigate: Review application and database logs for any suspicious login attempts, particularly those involving unusual query patterns in the password field.
  3. Monitor: As with any critical authentication bypass, administrators should be vigilant for signs of compromise. For more on responding to potential incidents, you can review recent breach reports.

There is no effective workaround for this vulnerability; patching is the only complete solution.

Security Insight

This vulnerability underscores the persistent risk of injection attacks, even in modern development stacks using NoSQL databases and typed languages like TypeScript. Type safety at compile time is not a substitute for rigorous input validation and sanitization at runtime. It serves as a critical reminder that security controls must be enforced where data is processed, not just where it is defined. For the latest on emerging threats and patches, follow our security news coverage.

Further Reading

Share:

Never miss a critical vulnerability

Get real-time security alerts delivered to your preferred platform.

Related Advisories

Never Miss a Critical Alert

CVE advisories, breach reports, and threat intel — delivered daily to your inbox.