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:
- Update: Upgrade your FastGPT installation to version 4.14.9.5 or higher without delay.
- Investigate: Review application and database logs for any suspicious login attempts, particularly those involving unusual query patterns in the password field.
- 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
Never miss a critical vulnerability
Get real-time security alerts delivered to your preferred platform.
Related Advisories
FastGPT is an AI Agent building platform. In versions prior to 4.14.9.5, the password change endpoint is vulnerable to NoSQL injection. An authenticated attacker can bypass the "old password" verifica...
A SQL injection vulnerability in CodeAstro Simple Attendance Management System v1.0 allows remote unauthenticated attackers to bypass authentication via the username parameter in index.php....
Improper input handling in /Grocery/search_products_itname.php, in anirudhkannan Grocery Store Management System 1.0, allows SQL injection via the sitem_name POST parameter....
In manikandan580 School-management-system 1.0, a time-based blind SQL injection vulnerability exists in /studentms/admin/between-date-reprtsdetails.php through the fromdate POST parameter....