Skip to content
Heist/ feed
Back to feed
Medium

MongoDB C Driver bson_strfreev may be susceptible to integer overflow

Type: advisorySources: OSV

The bson_strfreev function in the MongoDB C driver library may be susceptible to an integer overflow where the function will try to free memory at a negative offset. This may result in memory corruption. This issue affected libbson versions prior to 1.26.2

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2024-6381
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 17:33 UTC · Revision 1

Source evidence

MongoDB C Driver bson_strfreev may be susceptible to integer overflow

core-osv · Original source

Published 2 Jul 2024, 17:14 UTC

The bson_strfreev function in the MongoDB C driver library may be susceptible to an integer overflow where the function will try to free memory at a negative offset. This may result in memory corruption. This issue affected libbson versions prior to 1.26.2

osv:CVE-2024-6381
Complete source record
{
  "id": "247a923884b7a2cb9e7ce10694963ae3a019fe1d4b717da821d1ff95735bf2ca",
  "url": "https://osv.dev/vulnerability/CVE-2024-6381",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "MongoDB C Driver bson_strfreev may be susceptible to integer overflow",
    "summary": "The bson_strfreev function in the MongoDB C driver library may be susceptible to an integer overflow where the function will try to free memory at a negative offset. This may result in memory corruption. This issue affected libbson versions prior to 1.26.2",
    "evidence": "osv:CVE-2024-6381",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2024-6381",
      "aliases": [
        "CVE-2024-6381"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/mongodb/mongo-c-driver",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "586171d661f584d841bdc32fc998e9f6cf903228"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:mongodb:libbson:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "1.26.2"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "1.26.1",
            "1.26.0",
            "1.11.0",
            "1.9.0-rc1",
            "1.9.0-rc0",
            "1.7.0-rc0",
            "1.6.0",
            "1.6.0-rc0",
            "1.5.0-rc4",
            "1.5.0-rc3",
            "1.5.0-rc2",
            "1.5.0-rc1",
            "1.5.0-rc0",
            "1.4.0-beta1",
            "1.3.0",
            "1.3.0-rc0",
            "1.1.11",
            "1.1.10",
            "1.1.9",
            "1.1.8",
            "1.1.7",
            "1.1.6",
            "1.1.5",
            "1.1.4",
            "1.1.2",
            "1.1.0",
            "1.1.0-rc0",
            "1.0.2",
            "1.0.0",
            "0.98.2",
            "0.98.0",
            "0.96.4",
            "0.96.0",
            "0.94.2",
            "0.94.0",
            "0.92.2",
            "0.92.0",
            "0.90.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-6381.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:37.787567194Z",
      "provider": "osv",
      "references": [
        "https://jira.mongodb.org/browse/CDRIVER-5622",
        "https://lists.debian.org/debian-lts-announce/2025/05/msg00012.html",
        "https://lists.debian.org/debian-lts-announce/2025/05/msg00027.html",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/6xxx/CVE-2024-6381.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2024-6381"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-680"
        ],
        "cna_assigner": "mongodb",
        "unresolved_ranges": [
          {
            "extracted_events": [
              {
                "range": [
                  {
                    "fixed": "1.26.2"
                  }
                ],
                "source": "AFFECTED_FIELD",
                "strategy": "StandardRange"
              }
            ]
          }
        ],
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/6xxx/CVE-2024-6381.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2024-6381",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 505342,
  "published_at": "2024-07-02T17:14:48.908+00:00"
}