CVE-2026-81525: mongodb Reject "." And NUL Bytes Vulnerability

HIGH
Advisory Identifier: GHSA-65fr-j4p9-vc33
CVSS 8.1
CWE-943
Published
Advisory Summary

CVE-2026-81525 is a HIGH (CVSS 8.1) reject "." and nul bytes vulnerability (CWE-943: Improper Neutralization of Special Elements in Data Query Logic) affecting mongodb libraries in the Packagist ecosystem. The issue involves reject "." and nul bytes in database and collection names. Remediation is available by upgrading affected packages to version 1.21.4, 2.4.1.

CVE-2026-81525 at a Glance

CVE Identifier CVE-2026-81525
GHSA Identifier GHSA-65fr-j4p9-vc33
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-943: Improper Neutralization of Special Elements in Data Query Logic
Affected Product mongodb
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 8.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-81525

To remediate this vulnerability, upgrade all affected mongodb dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

mongodb/mongodb fixed: 1.21.4
Upgrade mongodb/mongodb to 1.21.4
mongodb/mongodb fixed: 2.4.1
Upgrade mongodb/mongodb to 2.4.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for mongodb/mongodb

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-81525, inspect your project dependencies for mongodb:

inspect dependencies for mongodb/mongodb

Analyze the terminal output to locate any version of mongodb in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.21.4), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-943: Improper Neutralization of Special Elements in Data Query Logic, where the product generates a query intended to access or manipulate data in a data store such as a database, but it does not neutralize or incorrectly neutralizes special elements that can modify the intended logic of the query. In mongodb, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact Passing untrusted input as part of a database or collection name may result in targeting a different database or collection than specified. ### Patches Fixed in PHP library 1.21.4 and 2.4.1. ### Workarounds Validate database and collection names prior to passing into APIs.

CVE-2026-81525 Affected mongodb Versions

2 component(s)
Fixed Versions:
1.21.42.4.1
Product / Package Ecosystem Affected Versions Fixed Version
mongodb/mongodb
Packagist
< 1.21.4
1.21.4
mongodb/mongodb
Packagist
≥ 2.0.0
< 2.4.1
2.4.1

References

Frequently Asked Questions

What is CVE-2026-81525?
CVE-2026-81525 is a security vulnerability in mongodb involving Reject "." and NUL bytes in database and collection names under CWE-943: Improper Neutralization of Special Elements in Data Query Logic.
Which mongodb versions are affected?
Affected versions include releases prior to 1.21.4, 2.4.1 across affected packages: mongodb/mongodb.
What version fixes CVE-2026-81525?
Upgrading to 1.21.4, 2.4.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mongodb/mongodb affected?
Yes, mongodb/mongodb is affected in releases prior to 1.21.4, 2.4.1. Upgrade your dependency to 1.21.4, 2.4.1 or later.
What is the CVSS score of CVE-2026-81525?
CVE-2026-81525 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2026-81525?
CVE-2026-81525 is classified under CWE-943: Improper Neutralization of Special Elements in Data Query Logic (The product generates a query intended to access or manipulate data in a data store such as a database, but it does not neutralize or incorrectly neutralizes special elements that can modify the intended logic of the query.).
How can I check Packagist dependencies for CVE-2026-81525?
Run the dependency tree command: 'inspect dependencies for mongodb/mongodb'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-65fr-j4p9-vc33",
  "modified" : "2026-09-08T21:27:42Z",
  "published" : "2026-09-08T21:27:42Z",
  "aliases" : [ "CVE-2026-81525" ],
  "summary" : "mongodb: Reject \".\" and NUL bytes in database and collection names",
  "details" : "### Impact\nPassing untrusted input as part of a database or collection name may result in targeting a different database or collection than specified.\n\n### Patches\nFixed in PHP library 1.21.4 and 2.4.1.\n\n### Workarounds\nValidate database and collection names prior to passing into APIs.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "mongodb/mongodb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.21.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "mongodb/mongodb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.4.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/mongodb/mongo-php-library/security/advisories/GHSA-65fr-j4p9-vc33"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-81525"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mongodb/mongo-php-library/pull/1967"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mongodb/mongo-php-library/pull/1968"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mongodb/mongo-php-library/commit/3a462213bb4fd46efa58a1937b06b1b0553b67a7"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mongodb/mongo-php-library/commit/6f305a3b21740080255a3093b12458274c7cc8ca"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mongodb/mongo-php-driver/releases/tag/1.21.6"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mongodb/mongo-php-driver/releases/tag/1.21.7"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mongodb/mongo-php-driver/releases/tag/2.4.1"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mongodb/mongo-php-library"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mongodb/mongo-php-library/releases/tag/1.21.4"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mongodb/mongo-php-library/releases/tag/2.4.1"
  }, {
    "type" : "WEB",
    "url" : "https://jira.mongodb.org/browse/PHPLIB-1927"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-943" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-08T21:27:42Z",
    "nvd_published_at" : "2026-08-27T20:18:50Z"
  }
}