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-40352

CVE-2026-40352: FastGPT Auth Bypass Vulnerability

CVE-2026-40352 is an authentication bypass flaw in FastGPT that exploits NoSQL injection to bypass password verification, enabling account takeover. This article covers the technical details, affected versions, and patches.

Published: April 23, 2026

CVE-2026-40352 Overview

CVE-2026-40352 is a NoSQL injection vulnerability affecting FastGPT, an AI Agent building platform. In versions prior to 4.14.9.5, the password change endpoint is vulnerable to NoSQL injection attacks. An authenticated attacker can bypass the "old password" verification by injecting MongoDB query operators, allowing unauthorized password changes without knowing the current password.

Critical Impact

This vulnerability enables full account takeover and persistence. An attacker with low-privileged session access can change account passwords without authentication, potentially compromising the entire FastGPT deployment and any connected AI agents or sensitive data.

Affected Products

  • FastGPT versions prior to 4.14.9.5
  • FastGPT AI Agent building platform (self-hosted deployments)
  • FastGPT instances with MongoDB backend

Discovery Timeline

  • 2026-04-17 - CVE-2026-40352 published to NVD
  • 2026-04-20 - Last updated in NVD database

Technical Details for CVE-2026-40352

Vulnerability Analysis

This vulnerability represents a classic NoSQL injection attack pattern targeting MongoDB-backed applications. The password change functionality in FastGPT fails to properly sanitize user input before constructing MongoDB queries. When a user attempts to change their password, the application accepts the "old password" parameter and uses it directly in a query to verify the user's identity. An attacker can exploit this by injecting MongoDB query operators such as $ne (not equal), $gt (greater than), or $regex to manipulate the query logic and bypass the password verification entirely.

The vulnerability is classified under CWE-943 (Improper Neutralization of Special Elements in Data Query Logic), which specifically addresses injection flaws in NoSQL databases. Unlike traditional SQL injection, NoSQL injection exploits the JSON-based query structure of databases like MongoDB.

Root Cause

The root cause is improper input validation and sanitization in the password change endpoint. The application directly incorporates user-supplied data into MongoDB queries without checking for or escaping special query operators. This allows attackers to modify the intended query logic by passing objects with MongoDB operators instead of simple string values.

For example, instead of passing a string for the old password field, an attacker can pass a JSON object like {"$ne": ""} which effectively tells MongoDB to match any password that is "not equal to empty string" - which would match any valid password.

Attack Vector

The attack requires network access and a low-privileged authenticated session. The attacker sends a crafted request to the password change endpoint with MongoDB query operators embedded in the old password field. This bypasses the verification check and allows setting a new password of the attacker's choosing. If combined with ID manipulation, this could potentially allow changing passwords of other accounts, leading to widespread account compromise.

The following code shows part of the security patch applied in the fix:

typescript
export type localeType = `${LangEnum}`;
export const LocaleList = ['en', 'zh-CN', 'zh-Hant'] as const;

+export const LanguageSchema = z.enum(LocaleList).meta({ description: '用户语言偏好' });

export const langMap = {
  [LangEnum.en]: {
    label: 'English(US)',

Source: GitHub Commit

The patch introduces schema validation using Zod to enforce strict typing on user inputs, preventing the injection of arbitrary objects containing MongoDB operators.

Detection Methods for CVE-2026-40352

Indicators of Compromise

  • Unusual password change requests containing JSON objects or special characters like $ne, $gt, $regex, $exists in authentication fields
  • Multiple failed authentication attempts followed by successful password changes without valid credentials
  • Audit logs showing password modifications where the old password verification appears to have been bypassed
  • Unexpected account lockouts or password reset notifications reported by legitimate users

Detection Strategies

  • Implement Web Application Firewall (WAF) rules to detect MongoDB operators in request parameters, specifically looking for patterns like {"$ne":, {"$gt":, and {"$regex":
  • Monitor application logs for password change requests with non-string values in the old password field
  • Deploy runtime application self-protection (RASP) solutions that can detect NoSQL injection attempts at the application layer
  • Implement anomaly detection for authentication-related API endpoints to identify unusual request patterns

Monitoring Recommendations

  • Enable detailed logging on the password change endpoint to capture full request payloads for forensic analysis
  • Set up alerts for any password change activity that doesn't follow expected user behavior patterns
  • Monitor MongoDB query logs for unexpected query structures or operators in authentication-related collections
  • Implement user behavior analytics to detect account takeover attempts based on post-compromise activities

How to Mitigate CVE-2026-40352

Immediate Actions Required

  • Upgrade FastGPT to version 4.14.9.5 or later immediately
  • Audit recent password change activities for any suspicious modifications
  • Force password resets for all user accounts if compromise is suspected
  • Review and revoke any suspicious sessions or API tokens
  • Enable multi-factor authentication (MFA) if available to add an additional layer of protection

Patch Information

The vulnerability has been patched in FastGPT version 4.14.9.5. The fix implements proper input validation using schema validation (Zod) to ensure that authentication parameters are strictly typed as strings and cannot contain MongoDB query operators. Organizations should upgrade immediately by following the official release notes available at the FastGPT GitHub Releases page. Additional details about the security fix can be found in the GitHub Security Advisory.

Workarounds

  • Implement input validation at the reverse proxy or WAF level to reject requests containing MongoDB operators in authentication fields
  • Deploy network segmentation to limit access to the FastGPT application from untrusted networks
  • Monitor and rate-limit password change requests to detect and block potential exploitation attempts
  • Consider temporarily disabling the password change functionality until the patch can be applied if immediate upgrade is not possible
bash
# Example WAF rule to block MongoDB operators in request body (ModSecurity format)
SecRule REQUEST_BODY "@rx \{\s*\"\$(ne|gt|lt|gte|lte|eq|regex|exists|in|nin)" \
    "id:100001,phase:2,deny,status:403,msg:'Potential NoSQL Injection Detected'"

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

  • SeverityHIGH

  • CVSS Score8.8

  • EPSS Probability0.03%

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

  • GitHub Release Notes

  • GitHub Security Advisory
  • Related CVEs
  • CVE-2026-40351: 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