Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-40351

CVE-2026-40351: FastGPT Auth Bypass Vulnerability

CVE-2026-40351 is an authentication bypass flaw in FastGPT AI Agent platform that exploits NoSQL injection to bypass password checks and gain unauthorized admin access. This article covers technical details, versions, impact, and patches.

Published: April 23, 2026

CVE-2026-40351 Overview

CVE-2026-40351 is a critical NoSQL injection vulnerability in FastGPT, an AI Agent building platform. The vulnerability exists in versions prior to 4.14.9.5 where the password-based login endpoint uses TypeScript type assertion without runtime validation. This allows an unauthenticated attacker to pass a MongoDB query operator object (e.g., {"$ne": ""}) as the password field, effectively bypassing the password check and enabling login as any user, including the root administrator.

Critical Impact

Unauthenticated attackers can bypass authentication and gain access to any user account, including administrator accounts, through NoSQL injection in the login endpoint.

Affected Products

  • FastGPT versions prior to 4.14.9.5
  • FastGPT AI Agent building platform with password-based authentication enabled
  • Self-hosted FastGPT deployments using MongoDB backend

Discovery Timeline

  • April 17, 2026 - CVE-2026-40351 published to NVD
  • April 20, 2026 - Last updated in NVD database

Technical Details for CVE-2026-40351

Vulnerability Analysis

This vulnerability (CWE-943: Improper Neutralization of Special Elements in Data Query Logic) arises from improper input validation in FastGPT's password-based authentication mechanism. The application uses TypeScript type assertions to handle login credentials, but these assertions only provide compile-time type checking—not runtime validation. When a user submits login credentials, the application directly uses the password field in a MongoDB query without sanitizing or validating its structure.

MongoDB supports query operators like $ne (not equal), $gt (greater than), and $regex for flexible querying. When an attacker passes {"$ne": ""} as the password field instead of a string, MongoDB interprets this as "password is not equal to empty string"—a condition that matches any non-empty password. This transforms the intended equality check into a trivially satisfiable condition.

Root Cause

The root cause is the absence of runtime type validation for user-supplied input in the authentication flow. TypeScript's type system operates at compile time and does not enforce types at runtime. When the application receives JSON input from an HTTP request, TypeScript has no mechanism to verify that the password field is actually a string rather than an object. The fix in version 4.14.9.5 introduces proper schema validation using Zod, as evidenced by the addition of LanguageSchema with z.enum() validation in the codebase, indicating a broader effort to add runtime validation across the application.

Attack Vector

The attack can be executed remotely over the network without any prior authentication. An attacker constructs a malicious HTTP POST request to the login endpoint with the username of a target account and a MongoDB query operator object as the password. The attack requires:

  1. Network access to the FastGPT login endpoint
  2. Knowledge of a valid username (e.g., "root" or "admin" for administrator access)
  3. No user interaction or special privileges
json
// Example malicious login payload
{
  "username": "root",
  "password": {"$ne": ""}
}

This payload causes the MongoDB query to match any user where the password is not empty, effectively bypassing authentication.

Detection Methods for CVE-2026-40351

Indicators of Compromise

  • Authentication log entries showing successful logins for privileged accounts from unexpected IP addresses or locations
  • HTTP POST requests to login endpoints containing JSON objects with MongoDB operators ($ne, $gt, $regex, $exists) in credential fields
  • Unusual administrative actions or data access following suspicious authentication events
  • Multiple successful logins for the same account from different geographic locations in a short timeframe

Detection Strategies

  • Implement Web Application Firewall (WAF) rules to detect and block requests containing MongoDB query operators in JSON payloads targeting authentication endpoints
  • Deploy application-level logging that captures the structure of authentication request payloads, flagging non-string values in password fields
  • Configure SIEM alerts for authentication anomalies, including successful logins from new IP addresses for privileged accounts
  • Monitor MongoDB query logs for authentication queries containing operator syntax rather than direct value comparisons

Monitoring Recommendations

  • Enable detailed access logging on all FastGPT authentication endpoints with full request body capture (ensure secure handling of captured credentials)
  • Implement real-time alerting for any successful authentication events associated with administrator or root accounts
  • Establish baseline authentication patterns and configure anomaly detection for deviations in login frequency, timing, or source locations
  • Review authentication logs regularly for patterns indicative of credential stuffing or injection attacks

How to Mitigate CVE-2026-40351

Immediate Actions Required

  • Upgrade FastGPT to version 4.14.9.5 or later immediately to apply the security fix
  • Audit authentication logs for any signs of exploitation or unauthorized access to privileged accounts
  • Rotate credentials for all user accounts, particularly administrator and root accounts, as a precautionary measure
  • Implement network-level access controls to restrict access to the FastGPT login endpoint from trusted IP ranges only

Patch Information

The vulnerability has been addressed in FastGPT version 4.14.9.5. The security fix adds runtime input validation using Zod schema validation to ensure that credential fields are properly typed strings before being used in database queries. Organizations should update by pulling the latest release from the official GitHub repository. The specific commit addressing this issue is available in the GitHub Commit Log. Additional details can be found in the GitHub Security Advisory GHSA-x8mx-2mr7-h9xg.

Workarounds

  • Deploy a reverse proxy or WAF in front of FastGPT configured to reject any authentication requests where the password field is not a string type
  • Implement application-level input validation middleware that sanitizes and validates all incoming JSON payloads before they reach the authentication logic
  • Temporarily restrict network access to the FastGPT instance to trusted internal networks only until the patch can be applied
  • Consider disabling password-based authentication temporarily if alternative authentication methods are available
bash
# Example nginx configuration to block NoSQL injection patterns
location /api/login {
    # Block requests containing MongoDB operators in body
    if ($request_body ~* "(\$ne|\$gt|\$lt|\$gte|\$lte|\$regex|\$exists|\$or|\$and)") {
        return 403;
    }
    proxy_pass http://fastgpt_backend;
}

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeAuth Bypass

  • Vendor/TechFastgpt

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability0.06%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-943
  • Technical References
  • GitHub Commit Log

  • GitHub Release v4.14.9.5

  • GitHub Security Advisory GHSA-x8mx-2mr7-h9xg
  • Related CVEs
  • CVE-2026-40352: FastGPT Auth Bypass Vulnerability

  • CVE-2026-40252: FastGPT Auth Bypass Vulnerability

  • CVE-2026-34162: FastGPT Auth Bypass Vulnerability

  • CVE-2026-26003: FastGPT Auth Bypass Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English