Skip to main content
A Leader in the 2026 Gartner® Magic Quadrant™ for Endpoint Protection. Six years running.Find Out Why
  • Experiencing a breach?
  • Blog
  • Careers
  • Platform & Products

    • Singularity™ Platform

      Unified Enterprise Security. Machine-Speed Protection, Intelligence, and Response.

    • XDR

      Native and Open Protection, Detection, and Response.

    • Integrations and Partners

      One-Click Integrations to Unlock the Power of SentinelOne.

    Product Tours
    Pricing & Packages
    Get a Demo
  • Solutions & Use Cases

    SentinelOne for Industries

    Security Tuned for Your Industry.

    See All Industries
    • Healthcare

      Protect Patient Data. Keep Clinical Systems Online.

    • Financial Services

      Stop Fraud and Ransomware. Stay Audit-Ready.

    • Federal Government

      FedRAMP and IL5-Ready Defense for Federal Missions.

    • Manufacturing

      Defend OT, IT, IIOT, and Supply Chains at Scale.

    • Energy

      Secure OT Systems and Critical Infrastructure.

    • Transportation and Logistics

      Defend Operations Across Fleet, Port, and Rail.

    • Higher Education

      Protect Open Networks Without Slowing Research.

    • K-12 Education

      Stop Ransomware. Protect Students, Staff, and Data.

    • Retail and Hospitality

      Defend Your Brand, Customer Data, and Bottom Line.

    • SMB & Startups

      Enterprise-Grade Defense for Fast Teams.

    See all solutions
  • Services

    Managed Services

    Wayfinder Threat Detection and Response.

    Learn More
    • Threat Hunting

      World-Class Expertise and Threat Intelligence.

    • Managed Detection and Response

      24/7 Expert MDR Across Your Entire Environment.

    • Incident Readiness and Response

      DFIR, Breach Readiness, and Compromise Assessments.

    Experiencing a breach?

    Our experts are here to help 24/7.

    1-855-868-3733
    Get Help Now
  • Partners

    Become a Partner

    • Become a SentinelOne Partner

      Join the Global SentinelOne Ecosystem

    • Explore MSSP Solutions

      Services Succeed Faster with SentinelOne

    • Form a Technology Alliance

      Integrated, Enterprise-Scale Solutions

    Find a Partner

    • Enlist a Response or Advisory Team

      Enlist Pro Response and Advisory Teams

    • SentinelOne for AWS

      Hosted Across AWS Regions Worldwide

    • SentinelOne for Google

      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale

    • Partner Locator

      Your Go-to Source for Our Top Partners in Your Region

    • Singularity Marketplace

      One-Click Integrations for Unified Prevention, Detection, and Response

      Explore integrations
    Partner Portal Login
  • Why SentinelOne

    • Why Choose SentinelOne

      AI-Powered Cybersecurity Built to Secure What’s Next.

    • Our Customers

      Trusted by the World’s Leading Companies.

    • Industry Awards & Recognition

      Tested and Proven by the Experts.

  • Resources & Support

    Resources

    • Resource Center
    • Webinars
    • Cybersecurity Blog
    • Events
    • Newsroom

    Company

    • About SentinelOne
    • Careers
    • S Ventures
    • S Foundation
    • Dataset
    • FAQ
    • Investors Relations

    Customer Success & Support

    • Live and On-Demand Training
    • Guided Onboarding & Deployment
    • Technical Account Management
    • Support Services
    • Customer Portal
    • Get Support Now

    Explore

    • Vulnerability Database
    • SentinelLABS Threat Research
    • Ransomeware Anthology
    • Cybersecurity 101
    EventJoin us at OneCon (Oct. 20–22, 2026)
    CompetitionThreat Hunting World Championship 2026
    ReportThe SentinelOne Annual Threat Report
  • Pricing
Get StartedContact us

Explore SentinelOne

  • Pricing
Events
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-42345: FastGPT Auth Bypass Vulnerability

  • CVE-2026-40351: FastGPT Auth Bypass Vulnerability

  • CVE-2026-40252: FastGPT Auth Bypass Vulnerability

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

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.

Try SentinelOne
Get a DemoContact Us
  • Product Tours
  • Why SentinelOne
  • Pricing & Packages
  • FAQ
  • SentinelOne Status

Key Products & Solutions

  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Prompt Security
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Explore Solutions

Services

  • Wayfinder TDR
  • Managed Detection and Response
  • Threat Hunting
  • Incident Readiness
& Response
  • Technical Account Management
  • Guided Onboarding 
& Deployment
  • Support Services

Company

  • About Us
  • Our Customers
  • Careers
  • Partners
  • S1 Foundation
  • S1 Ventures
  • Legal Information
  • Security & Compliance
  • Investor Relations

Quick Links

  • Customer Portal
  • Partner Portal
  • Become a Partner
  • Resource Center
  • SentinelLABS Threat Research
  • Blog
  • Press Center
  • Cybersecurity 101
  • Events
  • Ransomware Anthology
©2026 SentinelOne, All Rights Reserved
Privacy NoticeTerms of Use
English
English