CVE-2026-2303: Go.mongodb.org/mongo driver Mongo-go-driver Has Heap Out-of-Bounds Read Vulnerability

MODERATE
Advisory Identifier: GHSA-cp6g-7hqx-qxhp
CVSS 6.5
CWE-183
Published
Advisory Summary

CVE-2026-2303 is a MODERATE (CVSS 6.5) mongo-go-driver has heap out-of-bounds read vulnerability (CWE-183: Permissive List of Allowed Inputs) affecting Go.mongodb.org/mongo driver libraries in the Go ecosystem. The issue involves mongo-go-driver has heap out-of-bounds read in gssapi error handling. Remediation is available by upgrading affected packages to version 1.17.7, 2.4.2.

CVE-2026-2303 at a Glance

CVE Identifier CVE-2026-2303
GHSA Identifier GHSA-cp6g-7hqx-qxhp
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-183: Permissive List of Allowed Inputs
Affected Product Go.mongodb.org/mongo driver
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.5

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:N/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 None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-2303

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

go.mongodb.org/mongo-driver fixed: 1.17.7
Upgrade go.mongodb.org/mongo-driver to 1.17.7
go.mongodb.org/mongo-driver/v2 fixed: 2.4.2
Upgrade go.mongodb.org/mongo-driver/v2 to 2.4.2
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 go.mongodb.org/mongo-driver

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-2303, inspect your project dependencies for Go.mongodb.org/mongo driver:

inspect dependencies for go.mongodb.org/mongo-driver

Analyze the terminal output to locate any version of Go.mongodb.org/mongo driver in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.17.7), 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-183: Permissive List of Allowed Inputs, where the product implements a protection mechanism that relies on a list of inputs (or properties of inputs) that are explicitly allowed by policy because the inputs are assumed to be safe, but the list is too permissive - that is, it allows an input that is unsafe, leading to resultant weaknesses. In Go.mongodb.org/mongo driver, 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

The mongo-go-driver repository contains CGo bindings for GSSAPI (Kerberos) authentication on Linux and macOS. The C wrapper implementation contains a heap out-of-bounds read vulnerability due to incorrect assumptions about string termination in the GSSAPI standard. Since GSSAPI buffers are not guaranteed to be null-terminated or have extra padding, this results in reading one byte past the allocated heap buffer.

CVE-2026-2303 Affected Go.mongodb.org/mongo driver Versions

2 component(s)
Fixed Versions:
1.17.72.4.2
Product / Package Ecosystem Affected Versions Fixed Version
go.mongodb.org/mongo-driver
Go
< 1.17.7
1.17.7
go.mongodb.org/mongo-driver/v2
Go
< 2.4.2
2.4.2

References

Frequently Asked Questions

What is CVE-2026-2303?
CVE-2026-2303 is a security vulnerability in Go.mongodb.org/mongo driver involving mongo-go-driver has Heap Out-of-Bounds Read in GSSAPI Error Handling under CWE-183: Permissive List of Allowed Inputs.
Which Go.mongodb.org/mongo driver versions are affected?
Affected versions include releases prior to 1.17.7, 2.4.2 across affected packages: go.mongodb.org/mongo-driver, go.mongodb.org/mongo-driver/v2.
What version fixes CVE-2026-2303?
Upgrading to 1.17.7, 2.4.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is go.mongodb.org/mongo-driver affected?
Yes, go.mongodb.org/mongo-driver is affected in releases prior to 1.17.7. Upgrade your dependency to 1.17.7 or later.
Is go.mongodb.org/mongo-driver/v2 affected?
Yes, go.mongodb.org/mongo-driver/v2 is affected in releases prior to 2.4.2. Upgrade your dependency to 2.4.2 or later.
What is the CVSS score of CVE-2026-2303?
CVE-2026-2303 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2026-2303?
CVE-2026-2303 is classified under CWE-183: Permissive List of Allowed Inputs (The product implements a protection mechanism that relies on a list of inputs (or properties of inputs) that are explicitly allowed by policy because the inputs are assumed to be safe, but the list is too permissive - that is, it allows an input that is unsafe, leading to resultant weaknesses.).
How can I check Go dependencies for CVE-2026-2303?
Run the dependency tree command: 'inspect dependencies for go.mongodb.org/mongo-driver'. 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-cp6g-7hqx-qxhp",
  "modified" : "2026-06-18T13:02:29Z",
  "published" : "2026-02-10T21:31:31Z",
  "aliases" : [ "CVE-2026-2303" ],
  "summary" : "mongo-go-driver has Heap Out-of-Bounds Read in GSSAPI Error Handling",
  "details" : "The mongo-go-driver repository contains CGo bindings for GSSAPI (Kerberos) authentication on Linux and macOS. The C wrapper implementation contains a heap out-of-bounds read vulnerability due to incorrect assumptions about string termination in the GSSAPI standard. Since GSSAPI buffers are not guaranteed to be null-terminated or have extra padding, this results in reading one byte past the allocated heap buffer.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "go.mongodb.org/mongo-driver"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.17.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "go.mongodb.org/mongo-driver/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.4.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-2303"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mongodb/mongo-go-driver"
  }, {
    "type" : "WEB",
    "url" : "https://jira.mongodb.org/browse/GODRIVER-3770"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-183" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-18T13:02:29Z",
    "nvd_published_at" : "2026-02-10T20:17:00Z"
  }
}