CVE-2026-40351

FastGPT: NoSQL Injection in loginByPassword leads to Authentication Bypass

Published Apr 17, 2026 CVSS 3.1 · 9.8 Critical EPSS < 1% KEV · Not listed
Description
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 attacker to pass a MongoDB query operator object (e.g., {"$ne": ""}) as the password field. This NoSQL injection bypasses the password check, enabling login as any user including the root administrator. This issue has been fixed in version 4.14.9.5.

Analysis

AI-generated

Technical impact

FastGPT uses type assertions instead of runtime checks on the loginByPassword endpoint. An unauthenticated attacker can submit a MongoDB query operator object as the password, which the underlying database interprets and therefore bypasses the password check. This allows login as any user, including the root administrator, giving full control over the system without credentials.

Affected Systems

The FastGPT AI Agent building platform is affected in all releases prior to v4.14.9.5. Versions v4.14.9.5 and later contain the fix.

Risk and Exploitability

The CVSS score of 9.8 classifies this as a critical severity vulnerability. The EPSS score is not available, and the issue is not listed in the CISA KEV catalog. The vulnerability is exploitable through the publicly exposed login endpoint without needing any prior authentication. An attacker can simply construct a carefully crafted request to inject the query operator and obtain privileged access.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade FastGPT to version 4.14.9.5 or later, which includes the fix for the NoSQL injection flaw.
  • Restrict network access to the authentication endpoint, for example by using a firewall or VPN, to limit exposure to trusted hosts.
  • Implement strict server‑side validation of password inputs to reject any MongoDB query operators or non‑alphanumeric characters.

Generated by OpenCVE AI on April 18, 2026 at 08:56 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Fastgpt
Fastgpt fastgpt
CPEs cpe:2.3:a:fastgpt:fastgpt:*:*:*:*:*:*:*:*
Vendors & Products Fastgpt
Fastgpt fastgpt
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Labring
Labring fastgpt
Vendors & Products Labring
Labring fastgpt
Type Values Removed Values Added
Description 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 attacker to pass a MongoDB query operator object (e.g., {"$ne": ""}) as the password field. This NoSQL injection bypasses the password check, enabling login as any user including the root administrator. This issue has been fixed in version 4.14.9.5.
Title FastGPT: NoSQL Injection in loginByPassword leads to Authentication Bypass
Weaknesses CWE-943
References
Metrics cvssV3_1

{'score': 9.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}

Weaknesses
  • CWE-943

    Improper Neutralization of Special Elements in Data Query Logic

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Apr 20, 2026, 2:57 PM
Reserved
Apr 10, 2026, 10:50 PM
Status
Analyzed
Published
Apr 17, 2026, 10:16 PM
Modified
Oct 26, 2026, 10:10 PM