CVE-2026-81407: Nmap < 7.992 Cleartext Credential Recovery via Hardcoded DH Exponent in afp.lua
Nmap before 7.992 contains a hardcoded cryptographic key vulnerability in the DHCAST128 login of the NSE afp.lua library, which uses a fixed, publicly known Diffie-Hellman private exponent. A passive observer of the network traffic between Nmap and an Apple Filing Protocol server can compute the shared secret from the hardcoded exponent and the server's public value and decrypt the password supplied to scripts such as afp-showmount.nse and afp-brute.nse through the afp.username and afp.password arguments, without man-in-the-middle access or cryptanalysis.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
nmapto a version that resolves this vulnerability.Fixed in 7.992
Event History
Frequently Asked Questions
Who is exposed to credential disclosure?
Users running affected Nmap versions who provide AFP credentials through afp.username and afp.password to NSE scripts such as afp-showmount.nse or afp-brute.nse are exposed. A passive observer of the traffic between Nmap and the Apple Filing Protocol server can recover the supplied password.
Does exploitation require active network interception or authentication?
No. An attacker only needs to passively observe the relevant network traffic; man-in-the-middle access, authentication, and cryptanalysis are not required.
Which configurations are affected?
The issue applies to DHCAST128 login performed by the NSE afp.lua library when AFP credentials are supplied to affected scripts. The provided data does not establish whether any script uses those credentials by default.
How can I determine whether my deployment is affected?
Check whether the Nmap version is earlier than 7.992 and whether AFP NSE scans use afp.lua with afp.username and afp.password arguments. If both conditions apply, passwords supplied during those scans may be recoverable from captured traffic.